Rev 1086 | Rev 1104 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1086 | Rev 1103 | ||
|---|---|---|---|
| Line 83... | Line 83... | ||
| 83 | { |
83 | { |
| 84 | void (*f)(void *) = THREAD->thread_code; |
84 | void (*f)(void *) = THREAD->thread_code; |
| 85 | void *arg = THREAD->thread_arg; |
85 | void *arg = THREAD->thread_arg; |
| 86 | 86 | ||
| 87 | /* this is where each thread wakes up after its creation */ |
87 | /* this is where each thread wakes up after its creation */ |
| 88 | before_thread_runs(); |
- | |
| 89 | - | ||
| 90 | spinlock_unlock(&THREAD->lock); |
88 | spinlock_unlock(&THREAD->lock); |
| 91 | interrupts_enable(); |
89 | interrupts_enable(); |
| 92 | 90 | ||
| 93 | f(arg); |
91 | f(arg); |
| 94 | thread_exit(); |
92 | thread_exit(); |
| Line 435... | Line 433... | ||
| 435 | */ |
433 | */ |
| 436 | __native sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name) |
434 | __native sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name) |
| 437 | { |
435 | { |
| 438 | thread_t *t; |
436 | thread_t *t; |
| 439 | char namebuf[THREAD_NAME_BUFLEN]; |
437 | char namebuf[THREAD_NAME_BUFLEN]; |
| 440 | uspace_arg_t *kernel_uarg; /* TODO: store kernel_uarg in thread_t */ |
438 | uspace_arg_t *kernel_uarg; |
| 441 | __u32 tid; |
439 | __u32 tid; |
| 442 | 440 | ||
| 443 | copy_from_uspace(namebuf, uspace_name, THREAD_NAME_BUFLEN); |
441 | copy_from_uspace(namebuf, uspace_name, THREAD_NAME_BUFLEN); |
| 444 | 442 | ||
| 445 | kernel_uarg = (uspace_arg_t *) malloc(sizeof(uspace_arg_t), 0); |
443 | kernel_uarg = (uspace_arg_t *) malloc(sizeof(uspace_arg_t), 0); |