Changeset 15740 for release


Ignore:
Timestamp:
Feb 18, 2013, 1:56:02 AM (6 years ago)
Author:
gb
Message:

merge more recent changes from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/1.9/source/lisp-kernel/thread_manager.c

    r15724 r15740  
    783783}
    784784 
     785#ifdef DARWIN
     786/* Sending signals to "workqueue threads" (created via libdispatch)
     787   via pthread_kill() isn't supported, unless the thread calls an
     788   undocumented internal function.
     789
     790   Someone got paid to design this.
     791*/
     792static Boolean looked_up_setkill = false;
     793typedef int(*setkillfn)(int);
     794static setkillfn setkill = NULL;
     795
     796void
     797try_enable_kill()
     798{
     799  if (!looked_up_setkill) {
     800    setkill = dlsym(RTLD_DEFAULT,"__pthread_workqueue_setkill");
     801    looked_up_setkill = true;
     802  }
     803  if (setkill) {
     804    setkill(1);
     805  }
     806}
     807#endif
     808
    785809void
    786810enqueue_tcr(TCR *new)
     
    789813 
    790814  LOCK(lisp_global(TCR_AREA_LOCK),new);
     815#ifdef DARWIN
     816  if (new->flags & (1<<TCR_FLAG_BIT_FOREIGN)) {
     817    try_enable_kill();
     818  }
     819#endif
    791820  head = (TCR *)ptr_from_lispobj(lisp_global(INITIAL_TCR));
    792821  tail = TCR_AUX(head)->prev;
Note: See TracChangeset for help on using the changeset viewer.