fix scheduler's support for `ffi/unsafe/try-atomic'

where problems with abort-without-dynamic-wind mode caused
  a spurious trigger of nack evts
 Merge to 5.1
(cherry picked from commit 3e38071dae)
This commit is contained in:
Matthew Flatt 2011-02-05 16:33:02 -07:00 committed by Eli Barzilay
parent 4c20048bff
commit 17157945bb
3 changed files with 17 additions and 2 deletions

View File

@ -1155,7 +1155,10 @@ typedef void (*Scheme_Kill_Action_Func)(void *);
thread = NULL; \
if (scheme_setjmp(newbuf)) { \
scheme_pop_kill_action(); \
func(data); \
thread = scheme_get_current_thread(); \
if (!thread->cjs.skip_dws) { \
func(data); \
} \
scheme_longjmp(*savebuf, 1); \
} else {
# define END_ESCAPEABLE() \

View File

@ -654,7 +654,8 @@ int scheme_wait_semas_chs(int n, Scheme_Object **o, int just_try, Syncing *synci
} else if (semas[i]->so.type == scheme_never_evt_type) {
/* Never ready. */
} else if (semas[i]->so.type == scheme_channel_syncer_type) {
/* Probably no need to poll */
if (((Scheme_Channel_Syncer *)semas[i])->picked)
break;
} else if (try_channel(semas[i], syncing, i, NULL))
break;
}

View File

@ -4051,6 +4051,9 @@ static void call_on_atomic_timeout(int must)
Scheme_Object *blocker;
Scheme_Ready_Fun block_check;
Scheme_Needs_Wakeup_Fun block_needs_wakeup;
Scheme_Kill_Action_Func private_on_kill;
void *private_kill_data;
void **private_kill_next;
/* Save any state that has to do with the thread blocking or
sleeping, in case scheme_on_atomic_timeout() runs Racket code. */
@ -4062,6 +4065,10 @@ static void call_on_atomic_timeout(int must)
block_check = p->block_check;
block_needs_wakeup = p->block_needs_wakeup;
private_on_kill = p->private_on_kill;
private_kill_data = p->private_kill_data;
private_kill_next = p->private_kill_next;
p->running = MZTHREAD_RUNNING;
p->sleep_end = 0.0;
p->block_descriptor = 0;
@ -4077,6 +4084,10 @@ static void call_on_atomic_timeout(int must)
p->blocker = blocker;
p->block_check = block_check;
p->block_needs_wakeup = block_needs_wakeup;
p->private_on_kill = private_on_kill;
p->private_kill_data = private_kill_data;
p->private_kill_next = private_kill_next;
}
static void find_next_thread(Scheme_Thread **return_arg) {