Mercurial > projects > ldc
comparison lphobos/std/thread.d @ 473:373489eeaf90
Applied downs' lphobos update
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Mon, 04 Aug 2008 19:28:49 +0200 |
parents | 5825d48b27d1 |
children |
comparison
equal
deleted
inserted
replaced
472:15c804b6ce77 | 473:373489eeaf90 |
---|---|
656 } | 656 } |
657 nthreads++; | 657 nthreads++; |
658 } | 658 } |
659 | 659 |
660 state = TS.RUNNING; | 660 state = TS.RUNNING; |
661 //printf("creating thread x%x\n", this); | 661 printf("creating thread x%x\n", this); |
662 //result = pthread_create(&id, null, &threadstart, this); | 662 //result = pthread_create(&id, null, &threadstart, this); |
663 // Create with thread attributes to allow non-default stack size - Dave Fladebo | 663 // Create with thread attributes to allow non-default stack size - Dave Fladebo |
664 int result = pthread_create(&id, &threadAttrs, &threadstart, cast(void*)this); | 664 int result = pthread_create(&id, &threadAttrs, &threadstart, cast(void*)this); |
665 if (result) | 665 if (result) |
666 { state = TS.FINISHED; | 666 { state = TS.FINISHED; |
667 synchronized (Thread.classinfo) allThreads[idx] = null; | 667 synchronized (Thread.classinfo) allThreads[idx] = null; |
668 idx = -1; | 668 idx = -1; |
669 error("failed to start"); // BUG: should report errno | 669 error("failed to start"); // BUG: should report errno |
670 } | 670 } |
671 //printf("t = x%x, id = %d\n", this, id); | 671 printf("t = x%x, id = %d\n", this, id); |
672 } | 672 } |
673 | 673 |
674 int run() | 674 int run() |
675 { | 675 { |
676 if (fp) | 676 if (fp) |