Fix another race in Notification Queue
authorGunjan Sharma <gunjan@fb.com>
Thu, 10 Jul 2014 00:50:19 +0000 (17:50 -0700)
committerTudor Bosman <tudorb@fb.com>
Mon, 14 Jul 2014 19:14:06 +0000 (12:14 -0700)
commitc765dfdffc042b6c6d9a871bdeb31389f68fac5c
tree6b13a3452814cc617ca9c98ba101b8c5018c0845
parentb6b4f60b12cc30ba10e91c8d12d7e2e9263ffc2c
Fix another race in Notification Queue

Summary: Consider a case we found that the queue is empty and unlocked and before our setActive(false) from SCOPE_EXIT gets called (or gets the lock) putMessageImpl got the lock. Now putMessage thinks that we donot want to add another signal but actually we do.

Test Plan:
Running mcreplay2 without running into this problem on a box.
Benchmark:

Reviewed By: davejwatson@fb.com

FB internal diff: D1428249
folly/io/async/NotificationQueue.h