+*/
+
+int pthread_pause_reschedule(pthread_t thread) {
+ //Decide if the thread should run
+
+ pthread_user_data_lock();
+ //Check if thread has running flag
+ int run = (pthread_user_data_internal(thread)->running);
+ //Check if privileged (single thread) mode is active
+ if((pthread_pause_holder != 0) && !pthread_equal(pthread_pause_holder, thread)) {
+ run = 0;
+ }
+ pthread_user_data_unlock();
+
+ //Send signal to initiate pause handler (keep trying while SigQueue is full)
+ //while(pthread_kill(thread, PTHREAD_XSIG_STOP) == EAGAIN) usleep(1000);
+ while(pthread_sigqueue(thread, PTHREAD_XSIG_STOP,
+ (const union sigval){.sival_int=run}
+ ) == EAGAIN) usleep(1000);
+ return 0;
+}