Yzena
/
Yc
2
1
Fork 0
Browse Source

Add a quicker way to check for multiple threads in the rwlock

This is temporary debugging code.

Signed-off-by: Gavin Howard <gavin@yzena.com>
afl_persistent_mode
Gavin Howard 4 months ago
parent
commit
c7abe1a8f2
Signed by: gavin
GPG Key ID: C08038BDF280D33E
  1. 1
      .gitignore
  2. 11
      src/rig/build.c

1
.gitignore vendored

@ -35,6 +35,7 @@
config.mak
Makefile
bin/
build/
bootstrap/
src/yao/python/yaoc

11
src/rig/build.c

@ -408,6 +408,8 @@ err:
return s;
}
static y_uint threads;
static y_Status
rig_searchPath(rig_rig* r, y_stackpool* pool, y_str* cmd)
{
@ -518,6 +520,13 @@ rig_searchPath(rig_rig* r, y_stackpool* pool, y_str* cmd)
y_eprintf("Thread %u entering write lock\n", y_strucon_id());
threads += 1;
if (threads > 1)
{
y_panica("More than one thread in the critical section");
}
// Make sure someone didn't get there first.
if (!y_map_existsStrings(&r->env.exec_map, (char*) cmd->a))
{
@ -529,6 +538,8 @@ rig_searchPath(rig_rig* r, y_stackpool* pool, y_str* cmd)
}
}
threads -= 1;
y_eprintf("Thread %u exiting write lock\n", y_strucon_id());
#ifdef RIG_ENV_USE_MUTEX

Loading…
Cancel
Save