diff options
author | David Hows <david.hows@mongodb.com> | 2016-06-24 17:05:13 +1000 |
---|---|---|
committer | David Hows <david.hows@mongodb.com> | 2016-06-24 17:05:13 +1000 |
commit | d8fb874fc40989cb9675e56ca80b3b64e6fa2ee3 (patch) | |
tree | 6f03ed5cde97aedc762215c14d23ee5305998a2b /src/log/log_slot.c | |
parent | fb1663e6fc800be97c0ddc697b6f939dc610e08e (diff) | |
parent | 1f4aaa4490a82cf947afdabbb9214ee5b1850d13 (diff) | |
download | mongo-d8fb874fc40989cb9675e56ca80b3b64e6fa2ee3.tar.gz |
Merge branch 'develop' of github.com:wiredtiger/wiredtiger into mongodb-3.4mongodb-3.3.9mongodb-3.3.10mongodb-3.0.1
Diffstat (limited to 'src/log/log_slot.c')
-rw-r--r-- | src/log/log_slot.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/log/log_slot.c b/src/log/log_slot.c index b7efb1d9018..47071211450 100644 --- a/src/log/log_slot.c +++ b/src/log/log_slot.c @@ -94,6 +94,17 @@ retry: if (WT_LOG_SLOT_DONE(new_state)) *releasep = 1; slot->slot_end_lsn = slot->slot_start_lsn; + /* + * A thread setting the unbuffered flag sets the unbuffered size after + * setting the flag. There could be a delay between a thread setting + * the flag, a thread closing the slot, and the original thread setting + * that value. If the state is unbuffered, wait for the unbuffered + * size to be set. + */ + while (WT_LOG_SLOT_UNBUFFERED_ISSET(old_state) && + slot->slot_unbuffered == 0) + __wt_yield(); + end_offset = WT_LOG_SLOT_JOINED_BUFFERED(old_state) + slot->slot_unbuffered; slot->slot_end_lsn.l.offset += (uint32_t)end_offset; |