Changeset 5f97ef44 in mainline for uspace/app


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)

Location:
uspace/app
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/modules/sleep/sleep.c

    r9912f49 r5f97ef44  
    132132        }
    133133
    134         async_usleep(duration);
     134        fibril_usleep(duration);
    135135
    136136        return CMD_SUCCESS;
  • uspace/app/mkbd/main.c

    r9912f49 r5f97ef44  
    295295                }
    296296
    297                 async_usleep(10000);
     297                fibril_usleep(10000);
    298298        }
    299299
  • 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
  • uspace/app/tester/stdio/logger2.c

    r9912f49 r5f97ef44  
    5656                            "Printing level %d (%s) into bravo sub-log.",
    5757                            (int) level, log_level_str(level));
    58                         async_usleep(1000 * 100);
     58                        fibril_usleep(1000 * 100);
    5959                }
    6060        }
  • uspace/app/vuhid/life.c

    r9912f49 r5f97ef44  
    4444        data->data_in_pos = 0;
    4545        data->data_in_last_pos = (size_t) -1;
    46         async_usleep(1000 * 1000 * 5);
     46        fibril_usleep(1000 * 1000 * 5);
    4747        usb_log_debug("%s", data->msg_born);
    4848        while (data->data_in_pos < data->data_in_count) {
    49                 async_usleep(1000 * data->data_in_pos_change_delay);
     49                fibril_usleep(1000 * data->data_in_pos_change_delay);
    5050                // FIXME: proper locking
    5151                data->data_in_pos++;
  • uspace/app/wavplay/dplay.c

    r9912f49 r5f97ef44  
    312312                    pos, usecs, real_delay, to_play);
    313313                if (real_delay)
    314                         async_usleep(real_delay);
     314                        fibril_usleep(real_delay);
    315315                /* update buffer position */
    316316                const errno_t ret = audio_pcm_get_buffer_pos(pb->device, &pos);
  • uspace/app/wavplay/drec.c

    r9912f49 r5f97ef44  
    167167        /* XXX Control returns even before we can be sure callbacks finished */
    168168        printf("Delay before playback termination\n");
    169         async_usleep(1000000);
     169        fibril_usleep(1000000);
    170170        printf("Terminate playback\n");
    171171}
  • uspace/app/wavplay/main.c

    r9912f49 r5f97ef44  
    341341        /* Wait for all fibrils to finish */
    342342        while (atomic_get(&playcount) > 0)
    343                 async_usleep(1000000);
     343                fibril_usleep(1000000);
    344344
    345345        /* Destroy parallel playback context, if initialized */
Note: See TracChangeset for help on using the changeset viewer.