Rich Felker
e803829e6b
fix potential deadlock bug in libc-internal locking logic
...
if a multithreaded program became non-multithreaded (i.e. all other
threads exited) while one thread held an internal lock, the remaining
thread would fail to release the lock. the the program then became
multithreaded again at a later time, any further attempts to obtain
the lock would deadlock permanently.
the underlying cause is that the value of libc.threads_minus_1 at
unlock time might not match the value at lock time. one solution would
be returning a flag to the caller indicating whether the lock was
taken and needs to be unlocked, but there is a simpler solution: using
the lock itself as such a flag.
note that this flag is not needed anyway for correctness; if the lock
is not held, the unlock code is harmless. however, the memory
synchronization properties associated with a_store are costly on some
archs, so it's best to avoid executing the unlock code when it is
unnecessary.
2013-09-20 02:00:27 -04:00
..
2012-10-15 18:51:53 -04:00
2012-10-04 21:01:56 -04:00
2012-10-19 00:27:03 -04:00
2013-09-16 11:52:39 -04:00
2012-11-19 16:58:09 +01:00
2012-09-29 01:14:07 -04:00
2011-03-20 00:16:43 -04:00
2013-09-20 02:00:27 -04:00
2012-07-11 11:34:46 -04:00
2011-08-07 11:14:32 -04:00
2011-02-12 00:22:29 -05:00
2011-05-06 21:45:48 -04:00
2011-08-06 20:09:51 -04:00
2012-05-25 00:35:09 -04:00
2012-05-23 14:13:54 -04:00
2011-09-18 10:14:37 -04:00
2012-10-05 11:51:50 -04:00
2012-04-24 16:32:23 -04:00
2011-02-12 00:22:29 -05:00
2013-07-22 13:57:02 -04:00
2012-11-08 17:04:20 -05:00
2011-03-07 15:46:37 -05:00
2011-02-17 17:16:20 -05:00
2012-11-11 15:38:04 -05:00
2012-11-11 15:38:04 -05:00
2012-11-11 15:38:04 -05:00
2012-11-11 15:38:04 -05:00
2013-02-01 22:10:40 -05:00
2013-02-01 22:10:40 -05:00
2011-09-28 18:00:02 -04:00
2013-07-22 13:57:02 -04:00
2012-08-17 17:13:53 -04:00
2011-03-07 15:42:52 -05:00
2012-11-08 17:04:20 -05:00
2013-07-22 13:57:02 -04:00
2011-09-26 13:14:41 -04:00
2011-10-02 22:58:28 -04:00
2013-07-22 13:57:02 -04:00
2011-09-26 00:25:13 -04:00
2012-09-06 22:44:55 -04:00
2012-09-06 22:44:55 -04:00
2011-03-07 16:20:12 -05:00
2012-11-08 17:04:20 -05:00
2013-07-22 13:57:02 -04:00
2013-07-22 13:57:02 -04:00
2013-09-16 10:56:01 -04:00
2012-07-12 11:23:43 -04:00
2011-08-14 15:17:36 -04:00
2013-09-15 02:00:32 +00:00
2011-05-30 11:31:07 -04:00
2013-06-08 11:36:41 -04:00
2013-06-26 22:02:23 -04:00
2011-03-03 18:30:44 -05:00
2012-11-08 17:04:20 -05:00
2011-07-30 08:02:14 -04:00
2012-07-12 11:23:43 -04:00
2011-03-17 20:41:37 -04:00
2011-02-12 00:22:29 -05:00
2012-11-17 18:42:16 -05:00
2013-07-22 13:57:02 -04:00
2011-08-07 04:50:02 -04:00
2012-11-17 18:42:16 -05:00
2012-09-06 22:44:55 -04:00
2011-10-03 00:27:47 -04:00
2012-08-17 17:13:53 -04:00
2011-02-12 00:22:29 -05:00
2012-11-08 17:04:20 -05:00
2012-11-17 18:42:16 -05:00
2013-07-22 13:57:02 -04:00
2013-07-22 13:57:02 -04:00
2013-07-22 13:57:02 -04:00
2011-03-08 12:08:40 -05:00
2011-02-12 00:22:29 -05:00
2012-11-08 17:04:20 -05:00
2011-08-03 10:21:32 -04:00
2012-09-06 22:44:55 -04:00
2012-09-06 22:44:55 -04:00
2011-08-03 10:21:32 -04:00
2011-08-03 10:21:32 -04:00
2011-10-01 09:11:35 -04:00
2011-08-03 10:21:32 -04:00
2011-03-07 16:43:25 -05:00
2012-11-08 17:04:20 -05:00
2013-07-22 13:57:02 -04:00
2013-06-03 16:35:59 -04:00
2011-04-20 21:41:45 -04:00
2011-09-04 21:37:07 -04:00
2011-05-30 11:31:07 -04:00
2013-06-26 21:34:44 -04:00
2012-11-11 15:38:04 -05:00
2011-03-03 18:30:44 -05:00
2013-03-26 23:07:31 -04:00
2011-02-12 00:22:29 -05:00
2011-02-12 00:22:29 -05:00
2011-09-16 14:33:51 -04:00
2011-09-16 14:33:51 -04:00
2011-03-24 23:06:48 -04:00
2011-08-06 20:09:51 -04:00
2011-03-04 00:45:59 -05:00
2012-09-06 22:44:55 -04:00
2011-04-19 13:16:59 -04:00
2013-06-26 21:41:51 -04:00
2011-10-26 00:28:47 -04:00
2012-09-06 22:44:55 -04:00
2012-07-24 00:51:36 -04:00
2011-03-04 00:45:59 -05:00
2011-03-04 00:45:59 -05:00
2013-09-02 15:19:37 -04:00
2011-04-17 11:43:03 -04:00
2012-10-04 21:01:56 -04:00
2012-08-17 17:13:53 -04:00