Skip to content

Commit

Permalink
Merge pull request eBay#47 from shosseinimotlagh/SDSTOR-11603
Browse files Browse the repository at this point in the history
SDSTOR-11603 :  Fix shared_mutex for multi threads
  • Loading branch information
shosseinimotlagh authored Aug 24, 2023
2 parents 0039581 + a7c37bb commit e36eb79
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class IOMgrConan(ConanFile):
name = "iomgr"
version = "9.2.3"
version = "9.2.4"
homepage = "https://github.com/eBay/IOManager"
description = "Asynchronous event manager"
topics = ("ebay", "nublox", "aio")
Expand Down
1 change: 0 additions & 1 deletion src/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ AlignOperands: false
AlignTrailingComments: true
AllowShortBlocksOnASingleLine: true
AllowShortIfStatementsOnASingleLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
# AllowShortFunctionsOnASingleLine: InlineOnly
# AllowShortLoopsOnASingleLine: false
Expand Down
6 changes: 4 additions & 2 deletions src/lib/reactor/fiber_lib_boost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ void FiberManagerLib::shared_mutex::lock() {
} else {
// Owned by the writer or reader, add ourselves to writer queue
if (s_writer_priority) {
++m_write_waiters;
am_i_write_waiter = true;
if (!am_i_write_waiter) {
++m_write_waiters;
am_i_write_waiter = true;
}
LOGTRACEMOD(iomgr, "[Writer Lock for ctx={}]: Queued, owned by owner={} num_readers={}",
(void*)active_ctx, (void*)m_write_owner, m_readers);
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/test_fiber_shared_mutex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ SISL_LOGGING_INIT(IOMGR_LOG_MODS, flip)

SISL_OPTION_GROUP(test_fiber_shared_mutex,
(num_threads, "", "num_threads", "number of threads",
::cxxopts::value< uint32_t >()->default_value("2"), "number"),
::cxxopts::value< uint32_t >()->default_value("10"), "number"),
(num_fibers, "", "num_fibers", "number of fibers per thread",
::cxxopts::value< uint32_t >()->default_value("8"), "number"),
::cxxopts::value< uint32_t >()->default_value("20"), "number"),
(num_iters, "", "num_iters", "number of iterations",
::cxxopts::value< uint64_t >()->default_value("10000"), "number"),
(spdk, "", "spdk", "spdk", ::cxxopts::value< bool >()->default_value("false"), "true or false"));
Expand Down

0 comments on commit e36eb79

Please sign in to comment.