Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/pthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ extern char monitor_thread_fence2;
extern char monitor_thread_fence3;
extern char monitor_thread_fence4;


static __thread int ignore_new_threads = 0;
/*
*----------------------------------------------------------------------
* INTERNAL THREAD FUNCTIONS
Expand Down Expand Up @@ -835,6 +837,7 @@ monitor_unblock_shootdown(void)
void
monitor_disable_new_threads(void)
{
#if 0
struct monitor_thread_node *tn;

tn = monitor_get_tn();
Expand All @@ -843,19 +846,28 @@ monitor_disable_new_threads(void)
return;
}
tn->tn_ignore_threads = 1;
#else
ignore_new_threads = 1;
#endif
}

void
monitor_enable_new_threads(void)
{
#if 0
struct monitor_thread_node *tn;


tn = monitor_get_tn();
if (tn == NULL) {
MONITOR_DEBUG1("unable to find thread node\n");
return;
}
tn->tn_ignore_threads = 0;
#else
ignore_new_threads = 0;
#endif

}

/*
Expand Down Expand Up @@ -1102,7 +1114,7 @@ MONITOR_WRAP_NAME(pthread_create)(PTHREAD_CREATE_PARAM_LIST)
* pthread_create(), don't put it on the thread list and don't
* give any callbacks.
*/
if (my_tn != NULL && my_tn->tn_ignore_threads) {
if (ignore_new_threads) {
MONITOR_DEBUG1("ignoring this new thread\n");
return (*real_pthread_create)(thread, attr, start_routine, arg);
}
Expand Down