Skip to content

Commit

Permalink
Fix coroutine lock core tests, remove useless code. --filter=[core]
Browse files Browse the repository at this point in the history
  • Loading branch information
matyhtf committed Dec 31, 2024
1 parent 4cb03b4 commit 1a40cd5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
2 changes: 1 addition & 1 deletion core-tests/src/lock/lock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ TEST(lock, try_rd) {
}

TEST(lock, coroutine_lock) {
CoroutineLock *lock = new CoroutineLock();
CoroutineLock *lock = new CoroutineLock(false);
ASSERT_EQ(lock->lock(), SW_ERROR_CO_OUT_OF_COROUTINE);
auto callback = [lock]() {
coroutine::run([lock](void *arg) {
Expand Down
11 changes: 0 additions & 11 deletions ext-src/swoole_coroutine_lock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,3 @@ static PHP_METHOD(swoole_coroutine_lock, trylock) {
CoroutineLock *lock = co_lock_get_and_check_ptr(ZEND_THIS);
SW_LOCK_CHECK_RETURN(lock->trylock());
}

static PHP_METHOD(swoole_coroutine_lock, trylock_read) {
CoroutineLock *lock = co_lock_get_and_check_ptr(ZEND_THIS);
SW_LOCK_CHECK_RETURN(lock->trylock_rd());
}

static PHP_METHOD(swoole_coroutine_lock, lock_read) {
CoroutineLock *lock = co_lock_get_and_check_ptr(ZEND_THIS);
SW_LOCK_CHECK_RETURN(lock->lock_rd());
}

0 comments on commit 1a40cd5

Please sign in to comment.