1. 26 9月, 2011 2 次提交
  2. 25 9月, 2011 2 次提交
  3. 24 9月, 2011 3 次提交
    • R
      fix ABA race in cond vars, improve them overall · 97c5b5a8
      Rich Felker 提交于
      previously, a waiter could miss the 1->0 transition of block if
      another thread set block to 1 again after the signal function set
      block to 0. we now use the caller's thread id as a unique token to
      store in block, which no other thread will ever write there. this
      ensures that if block still contains the tid, no signal has occurred.
      spurious wakeups will of course occur whenever there is a spurious
      return from the futex wait and another thread has begun waiting on the
      cond var. this should be a rare occurrence except perhaps in the
      presence of interrupting signal handlers.
      
      signal/bcast operations have been improved by noting that they need
      not avoid inspecting the cond var's memory after changing the futex
      value. because the standard allows spurious wakeups, there is no way
      for an application to distinguish between a spurious wakeup just
      before another thread called signal/bcast, and the deliberate wakeup
      resulting from the signal/bcast call. thus the woken thread must
      assume that the signalling thread may still be waiting to act on the
      cond var, and therefore it cannot destroy/unmap the cond var.
      97c5b5a8
    • R
      FD_ISSET must return an int. this is the easiest way. · c41a76f5
      Rich Felker 提交于
      casting to int would not be correct because high bits could be lost.
      mapping the high bits down onto low bits would be costlier in the
      common case where the result is just used in a conditional. changing
      the type of the bit array elements to int would permute the order of
      the bit array on 64-bit big endian systems, so that's not an option
      either.
      c41a76f5
    • R
      sys/user.h may need stdint.h · 1587224e
      Rich Felker 提交于
      1587224e
  4. 23 9月, 2011 5 次提交
  5. 22 9月, 2011 10 次提交
  6. 21 9月, 2011 3 次提交
  7. 20 9月, 2011 8 次提交
  8. 19 9月, 2011 6 次提交
  9. 18 9月, 2011 1 次提交
    • R
      overhaul clone syscall wrapping · 3f72cdac
      Rich Felker 提交于
      several things are changed. first, i have removed the old __uniclone
      function signature and replaced it with the "standard" linux
      __clone/clone signature. this was necessary to expose clone to
      applications anyway, and it makes it easier to port __clone to new
      archs, since it's now testable independently of pthread_create.
      
      secondly, i have removed all references to the ugly ldt descriptor
      structure (i386 only) from the c code and pthread structure. in places
      where it is needed, it is now created on the stack just when it's
      needed, in assembly code. thus, the i386 __clone function takes the
      desired thread pointer as its argument, rather than an ldt descriptor
      pointer, just like on all other sane archs. this should not affect
      applications since there is really no way an application can use clone
      with threads/tls in a way that doesn't horribly conflict with and
      clobber the underlying implementation's use. applications are expected
      to use clone only for creating actual processes, possibly with new
      namespace features and whatnot.
      3f72cdac