| 98 | } |
| 99 | |
| 100 | void* butex_player(void* void_arg) { |
| 101 | PlayerArg* arg = static_cast<PlayerArg*>(void_arg); |
| 102 | int counter = INITIAL_FUTEX_VALUE; |
| 103 | while (!stop) { |
| 104 | int rc = bthread::butex_wait(arg->wait_addr, counter, NULL); |
| 105 | ++counter; |
| 106 | ++*arg->wake_addr; |
| 107 | bthread::butex_wake(arg->wake_addr); |
| 108 | ++arg->counter; |
| 109 | arg->wakeup += (rc == 0); |
| 110 | } |
| 111 | return NULL; |
| 112 | } |
| 113 | |
| 114 | TEST(PingPongTest, ping_pong) { |
| 115 | signal(SIGINT, quit_handler); |
nothing calls this directly
no test coverage detected