mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-15 09:26:21 +03:00
Restructure and correct sleep utility for testing
This commit is contained in:
parent
7b67ed0b5a
commit
a72ea0db60
5 changed files with 7 additions and 5 deletions
|
|
@ -124,6 +124,7 @@ static const bool config_debug =
|
|||
#include "test/math.h"
|
||||
#include "test/mtx.h"
|
||||
#include "test/mq.h"
|
||||
#include "test/sleep.h"
|
||||
#include "test/test.h"
|
||||
#include "test/timer.h"
|
||||
#include "test/thd.h"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
void mq_nanosleep(unsigned ns);
|
||||
#include "test/sleep.h"
|
||||
|
||||
/*
|
||||
* Simple templated message queue implementation that relies on only mutexes for
|
||||
|
|
@ -82,7 +82,7 @@ a_prefix##get(a_mq_type *mq) { \
|
|||
\
|
||||
ns = 1; \
|
||||
while (true) { \
|
||||
mq_nanosleep(ns); \
|
||||
sleep_ns(ns); \
|
||||
msg = a_prefix##tryget(mq); \
|
||||
if (msg != NULL) { \
|
||||
return msg; \
|
||||
|
|
|
|||
1
test/include/test/sleep.h
Normal file
1
test/include/test/sleep.h
Normal file
|
|
@ -0,0 +1 @@
|
|||
void sleep_ns(unsigned ns);
|
||||
Loading…
Add table
Add a link
Reference in a new issue