Small changes; slightly faster than tsan11rec in jsbench now
[c11tester.git] / sleeps.cc
index becc98c8b7dc154413385771fe7ce7765bfb34a3..2b70582ddb776ec31ea2087a9d6e9241cf348694 100644 (file)
--- a/sleeps.cc
+++ b/sleeps.cc
@@ -13,13 +13,13 @@ unsigned int sleep(unsigned int seconds)
 {
        /* https://code.woboq.org/userspace/glibc/sysdeps/posix/sleep.c.html */
        const unsigned int max
-       = (unsigned int) (((unsigned long int) (~((time_t) 0))) >> 1);
+               = (unsigned int) (((unsigned long int) (~((time_t) 0))) >> 1);
 
        struct timespec ts = { 0, 0 };
        do {
                if (sizeof (ts.tv_sec) <= sizeof (seconds)) {
                        /* Since SECONDS is unsigned assigning the value to .tv_sec can
-                        overflow it.  In this case we have to wait in steps.  */
+                          overflow it.  In this case we have to wait in steps.  */
                        ts.tv_sec += MIN (seconds, max);
                        seconds -= (unsigned int) ts.tv_sec;
                } else {
@@ -50,7 +50,7 @@ int nanosleep(const struct timespec *rqtp, struct timespec *rmtp)
                struct timespec currtime;
                clock_gettime(CLOCK_MONOTONIC, &currtime);
                uint64_t lcurrtime = currtime.tv_sec * 1000000000 + currtime.tv_nsec;
-               model->switch_to_master(new ModelAction(THREAD_SLEEP, std::memory_order_seq_cst, time, lcurrtime));
+               model->switch_thread(new ModelAction(THREAD_SLEEP, std::memory_order_seq_cst, time, lcurrtime));
                if (rmtp != NULL) {
                        clock_gettime(CLOCK_MONOTONIC, &currtime);
                        uint64_t lendtime = currtime.tv_sec * 1000000000 + currtime.tv_nsec;