ext-uv/tests/700-uv_rwlock.phpt
Bob Weinand 30c34d72a3 pthread_rwlock requires the lock being unlocked as often as it has been acquired
tests/700-uv_rwlock.phpt throws a notice inside resource dtor, which causes a memory leak in PHP; setting track_errors=0 temporarily there for having the test pass here.
2016-11-01 16:32:05 +01:00

28 lines
488 B
PHP

--TEST--
Check for uv_rwlock
--INI--
track_errors=0
--FILE--
<?php
$lock = uv_rwlock_init();
uv_rwlock_rdlock($lock);
if (uv_rwlock_tryrdlock($lock)) {
echo "OK" . PHP_EOL;
} else {
echo "FAILED" . PHP_EOL;
}
uv_rwlock_rdunlock($lock);
if (uv_rwlock_tryrdlock($lock)) {
echo "OK" . PHP_EOL;
} else {
echo "FAILED" . PHP_EOL;
}
uv_rwlock_rdunlock($lock);
--EXPECT--
OK
OK
Notice: Unknown: uv_rwlock: still locked resource detected; forcing rdunlock in Unknown on line 0