1. 18 4月, 2011 2 次提交
    • R
      clean up handling of thread/nothread mode, locking · 9080cc15
      Rich Felker 提交于
      9080cc15
    • R
      optimize cancellation enable/disable code · ebf82447
      Rich Felker 提交于
      the goal is to be able to use pthread_setcancelstate internally in
      the implementation, whenever a function might want to use functions
      which are cancellation points but avoid becoming a cancellation point
      itself. i could have just used a separate internal function for
      temporarily inhibiting cancellation, but the solution in this commit
      is better because (1) it's one less implementation-specific detail in
      functions that need to use it, and (2) application code can also get
      the same benefit.
      
      previously, pthread_setcancelstate dependend on pthread_self, which
      would pull in unwanted thread setup overhead for non-threaded
      programs. now, it temporarily stores the state in the global libc
      struct if threads have not been initialized, and later moves it if
      needed. this way we can instead use __pthread_self, which has no
      dependencies and assumes that the thread register is already valid.
      ebf82447
  2. 14 4月, 2011 1 次提交
    • R
      simplify cancellation point handling · 9beb6330
      Rich Felker 提交于
      we take advantage of the fact that unless self->cancelpt is 1,
      cancellation cannot happen. so just increment it by 2 to temporarily
      block cancellation. this drops pthread_create.o well under 1k.
      9beb6330
  3. 06 4月, 2011 1 次提交
    • R
      new framework to inhibit thread cancellation when needed · 729cb49f
      Rich Felker 提交于
      with these small changes, libc functions which need to call functions
      which are cancellation points, but which themselves must not be
      cancellation points, can use the CANCELPT_INHIBIT and CANCELPT_RESUME
      macros to temporarily inhibit all cancellation.
      729cb49f
  4. 12 2月, 2011 1 次提交