Changeset 0319a8f6 in mainline


Ignore:
Timestamp:
2006-04-05T12:10:53Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a7818c26
Parents:
8fe1cdb
Message:

Sync uspace.
Fix comment in futex.c.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • init/init.c

    r8fe1cdb r0319a8f6  
    4040atomic_t ftx;
    4141
    42 int __thread tls_prom;
     42int __thread stage;
    4343
    4444extern void utest(void *arg);
     
    258258static int ptest(void *arg)
    259259{
    260         tls_prom = -1;
    261         printf("Pseudo thread stage%d.\n", -tls_prom);
    262         tls_prom = -2;
     260        stage = 1;
     261        printf("Pseudo thread stage%d.\n", stage);
     262        stage++;
    263263        psthread_schedule_next();
    264         printf("Pseudo thread stage%d.\n", -tls_prom);
    265         tls_prom = -3;
     264        printf("Pseudo thread stage%d.\n", stage);
     265        stage++;
    266266        psthread_schedule_next();
    267         printf("Pseudo thread stage%d\n", -tls_prom);
     267        printf("Pseudo thread stage%d.\n", stage);
    268268        psthread_schedule_next();
    269         printf("Pseudo thread stage4.\n");
     269        stage++;
     270        printf("Pseudo thread stage%d.\n", stage);
    270271        psthread_schedule_next();
    271272        printf("Pseudo thread exiting.\n");
     
    296297        if (futex_down(&ftx) < 0)
    297298                printf("Futex failed.\n");
    298 /*
     299
    299300        if ((tid = thread_create(utest, NULL, "utest")) != -1) {
    300301                printf("Created thread tid=%d\n", tid);
     
    304305                printf("Created thread tid=%d\n", tid);
    305306        }
    306 */
     307
    307308        int i;
    308309       
     
    314315
    315316
    316         printf("Creating pathread\n");
    317         tls_prom = 1;
     317        printf("Creating pseudo thread.\n");
     318        stage = 1;
    318319        ptid = psthread_create(ptest, NULL);
    319         printf("Main thread stage%d\n",tls_prom);
    320         tls_prom = 2;
     320        printf("Main thread stage%d.\n", stage);
     321        stage++;
    321322        psthread_schedule_next();;
    322         printf("Main thread stage%d\n", tls_prom);
    323         tls_prom = 3;
     323        printf("Main thread stage%d.\n", stage);
     324        stage++;
    324325        psthread_schedule_next();;
    325         printf("Main thread stage%d\n", tls_prom);
     326        printf("Main thread stage%d.\n", stage);
    326327
    327328        psthread_join(ptid);
  • libc/generic/futex.c

    r8fe1cdb r0319a8f6  
    3939 * counter and the futex wait queue, there is a race condition:
    4040 *
    41  * wq->missed_wakeups == 1 && futex->count = 1
     41 * (wq->missed_wakeups == 1) && (futex->count = 1)
    4242 *
    4343 * Scenario 1 (wait queue timeout vs. futex_up()):
     
    155155 * @param futex Futex.
    156156 *
    157  * @return ENOENT if there is no such virtual address or futex. Otherwise zero.
     157 * @return ENOENT if there is no such virtual address. Otherwise zero.
    158158 */
    159159int futex_up(atomic_t *futex)
Note: See TracChangeset for help on using the changeset viewer.