^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #include <liblockdep/rwlock.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) void main(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) pthread_rwlock_t a, b;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) pthread_rwlock_init(&a, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) pthread_rwlock_init(&b, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) pthread_rwlock_wrlock(&a);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) pthread_rwlock_rdlock(&b);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) pthread_rwlock_wrlock(&a);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) }