-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[6.0]support coroutine lock feature #5554
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5554 +/- ##
==========================================
- Coverage 70.84% 70.65% -0.20%
==========================================
Files 108 109 +1
Lines 16720 16764 +44
Branches 3057 3064 +7
==========================================
- Hits 11846 11844 -2
- Misses 4818 4864 +46
Partials 56 56 ☔ View full report in Codecov by Sentry. |
5f20841
to
e63515b
Compare
e63515b
to
ef2acc2
Compare
…into coroutine_lock_feature
src/coroutine/iouring.cc
Outdated
@@ -54,6 +58,9 @@ struct IouringEvent { | |||
const char *pathname; | |||
const char *pathname2; | |||
struct statx *statxbuf; | |||
#ifdef HAVE_IOURING_FUTEX | |||
uint32_t *futex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be unioned with other fields to save memory
src/coroutine/iouring.cc
Outdated
#ifdef HAVE_IOURING_FUTEX | ||
case SW_IORING_OP_FUTEX_WAIT: | ||
case SW_IORING_OP_FUTEX_WAKE: | ||
return "FUTEX"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be displayed separately
Coroutine *current_coroutine = Coroutine::get_current(); | ||
if (current_coroutine == nullptr) { | ||
swoole_warning("The coroutine lock can only be used in a coroutine environment"); | ||
return 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should return an error code
src/lock/coroutine_lock.cc
Outdated
return 1; | ||
} | ||
|
||
result = Iouring::futex_wait((uint32_t *) value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No check result is given. If the wait fails, it means that the lock ownership is not obtained.
…into coroutine_lock_feature
No description provided.