Actions
Backport #25221
closedluminous: common: Cond.h:C_SaferCond does not check done before calling cond.WaitInterval, creating a race condition
Status:
Rejected
Priority:
Normal
Assignee:
-
Target version:
-
Release:
luminous
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Updated by Nathan Cutler over 5 years ago
- Copied from Bug #25007: common: Cond.h:C_SaferCond does not check done before calling cond.WaitInterval, creating a race condition added
Updated by Prashant D over 5 years ago
- Status changed from New to Need More Info
- Assignee set to Prashant D
Should we add wait_for to backport 25007 changes to luminous ?
$ git diff
diff --cc src/common/Cond.h
index aa53b60f23,949f293343..0000000000
--- a/src/common/Cond.h
++ b/src/common/Cond.h@
-194,6 -195,18 +194,21 @
public
cond.Wait(lock);
return rval;
}
+<<<<<<< HEAD
+=======
+ /// Wait until the \c secs expires or \c complete() is called
+ int wait_for(double secs) {
+ utime_t interval;
+ interval.set_from_double(secs);
+ Mutex::Locker l{lock};
+ if (done) {
+ return rval;
+ }
+ cond.WaitInterval(lock, interval);
+ return done ? rval : ETIMEDOUT;
+ }
++>>>>>>> 7090ea24dd... common: check completion condition before waiting
};
Updated by Nathan Cutler about 3 years ago
- Status changed from Need More Info to Rejected
Actions