Changeset 1cef26f in mainline
- Timestamp:
- 2006-03-22T22:30:40Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 29a9f62
- Parents:
- 7e2988c
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
init/init.c
r7e2988c r1cef26f 34 34 #include <ns.h> 35 35 #include <thread.h> 36 #include <futex.h> 36 37 37 38 int a; 39 atomic_t ftx; 38 40 39 41 extern void utest(void *arg); … … 41 43 { 42 44 printf("Uspace thread started.\n"); 45 if (futex_down(&ftx) < 0) 46 printf("Futex failed.\n"); 47 if (futex_up(&ftx) < 0) 48 printf("Futex failed.\n"); 49 50 printf("%s in good condition.\n", __FUNCTION__); 51 43 52 for (;;) 44 53 ; … … 244 253 } 245 254 255 256 246 257 int main(int argc, char *argv[]) 247 258 { … … 256 267 // test_hangup(); 257 268 // test_slam(); 269 270 futex_initialize(&ftx, 1); 271 if (futex_down(&ftx) < 0) 272 printf("Futex failed.\n"); 273 if (futex_up(&ftx) < 0) 274 printf("Futex failed.\n"); 275 276 if (futex_down(&ftx) < 0) 277 printf("Futex failed.\n"); 258 278 259 279 if ((tid = thread_create(utest, NULL, "utest") != -1)) { 260 280 printf("Created thread tid=%d\n", tid); 261 281 } 282 283 int i; 284 285 for (i = 0; i < 10000000; i++) 286 ; 287 288 if (futex_up(&ftx) < 0) 289 printf("Futex failed.\n"); 290 291 printf("Main thread exiting.\n"); 262 292 return 0; 263 293 } -
libc/Makefile
r7e2988c r1cef26f 47 47 generic/string.c \ 48 48 generic/thread.c \ 49 generic/futex.c \ 49 50 generic/io/io.c \ 50 51 generic/io/print.c \
Note:
See TracChangeset
for help on using the changeset viewer.