Changeset 183788f1 in mainline for uspace/tester/thread/thread1.c


Ignore:
Timestamp:
2007-04-09T16:17:25Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
36f19c0
Parents:
de33dab
Message:

Remove printf() serialization from thread1 test in tester.
The agreement among developers seems to be that:

  • there _must_ be a futex to serialize access to printf()
  • there _must_ be pseudo thread serialization in printf()
  • the best place for this is vprintf(), the one that goes to console
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/tester/thread/thread1.c

    rde33dab r183788f1  
    3434#include <stdio.h>
    3535#include <unistd.h>
    36 #include <futex.h>
    3736#include "../tester.h"
    3837
     
    4140static bool sh_quiet;
    4241
    43 static atomic_t srlz = FUTEX_INITIALIZER;
    44 
    4542static void threadtest(void *data)
    4643{
     
    4845
    4946        while (atomic_get(&finish)) {
    50                 if (!sh_quiet) {
    51                         futex_down(&srlz);
     47                if (!sh_quiet)
    5248                        printf("%llu ", thread_get_id());
    53                         futex_up(&srlz);
    54                 }
    5549                usleep(100000);
    5650        }
     
    7569        }
    7670       
    77         if (!quiet) {
    78                 futex_down(&srlz);
     71        if (!quiet)
    7972                printf("Running threads for 10 seconds...\n");
    80                 futex_up(&srlz);
    81         }
    8273        sleep(10);
    8374       
Note: See TracChangeset for help on using the changeset viewer.