Changeset 5f97ef44 in mainline for uspace/app/rcutest/rcutest.c


Ignore:
Timestamp:
2018-07-13T14:10:15Z (7 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e3787a0
Parents:
9912f49
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-13 14:08:57)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-13 14:10:15)
Message:

Sleep is more natural as part of the fibril API.
(the implementation will move later)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/rcutest/rcutest.c

    r9912f49 r5f97ef44  
    321321        printf("r-sleep{");
    322322        /* 2 sec */
    323         async_usleep(2 * USECS_PER_SEC);
     323        fibril_usleep(2 * USECS_PER_SEC);
    324324        ++arg->done_sleeps_cnt;
    325325        printf("}");
     
    346346
    347347        /* 1 sec, waits for the reader to enter its critical section and sleep. */
    348         async_usleep(1 * USECS_PER_SEC);
     348        fibril_usleep(1 * USECS_PER_SEC);
    349349
    350350        if (!info.entered_cs || info.exited_cs) {
     
    369369                 */
    370370                /* 1.5 sec */
    371                 async_usleep(1500 * 1000);
     371                fibril_usleep(1500 * 1000);
    372372                return false;
    373373        } else {
     
    402402        /* Wait for rcu_sync() to start waiting for us. */
    403403        while (!arg->synching) {
    404                 async_usleep(WAIT_STEP_US);
     404                fibril_usleep(WAIT_STEP_US);
    405405        }
    406406        printf(" }");
     
    411411        /* Wait for the new reader to enter its reader section. */
    412412        while (!arg->new_entered_cs) {
    413                 async_usleep(WAIT_STEP_US);
     413                fibril_usleep(WAIT_STEP_US);
    414414        }
    415415        printf(" }");
     
    437437        /* Wait until rcu_sync() starts. */
    438438        while (!arg->synching) {
    439                 async_usleep(WAIT_STEP_US);
     439                fibril_usleep(WAIT_STEP_US);
    440440        }
    441441
     
    444444         * some more to make sure it really does start executing.
    445445         */
    446         async_usleep(WAIT_STEP_US);
     446        fibril_usleep(WAIT_STEP_US);
    447447
    448448        printf("new-lock(");
     
    452452        /* Wait for rcu_sync() exit, ie stop waiting for the preexisting reader. */
    453453        while (!arg->synched) {
    454                 async_usleep(WAIT_STEP_US);
     454                fibril_usleep(WAIT_STEP_US);
    455455        }
    456456
     
    487487        /* Waits for the preexisting_reader to enter its CS.*/
    488488        while (!info.old_entered_cs) {
    489                 async_usleep(WAIT_STEP_US);
     489                fibril_usleep(WAIT_STEP_US);
    490490        }
    491491
     
    533533                 * are using it.
    534534                 */
    535                 async_usleep(WAIT_STEP_US);
     535                fibril_usleep(WAIT_STEP_US);
    536536        }
    537537
     
    565565        /* Wait for rcu_sync() to start waiting for us. */
    566566        while (!arg->synching) {
    567                 async_usleep(WAIT_STEP_US);
     567                fibril_usleep(WAIT_STEP_US);
    568568        }
    569569        printf(" }");
     
    591591        /* Waits for the preexisting_reader to enter its CS.*/
    592592        while (!info.entered_cs) {
    593                 async_usleep(WAIT_STEP_US);
     593                fibril_usleep(WAIT_STEP_US);
    594594        }
    595595
Note: See TracChangeset for help on using the changeset viewer.