Rev 4345 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4345 | Rev 4348 | ||
---|---|---|---|
Line 149... | Line 149... | ||
149 | spinlock_initialize(&ta->lock, "task_ta_lock"); |
149 | spinlock_initialize(&ta->lock, "task_ta_lock"); |
150 | list_initialize(&ta->th_head); |
150 | list_initialize(&ta->th_head); |
151 | ta->as = as; |
151 | ta->as = as; |
152 | 152 | ||
153 | memcpy(ta->name, name, TASK_NAME_BUFLEN); |
153 | memcpy(ta->name, name, TASK_NAME_BUFLEN); |
154 | ta->name[TASK_NAME_BUFLEN - 1] = '\0'; |
154 | ta->name[TASK_NAME_BUFLEN - 1] = 0; |
155 | 155 | ||
156 | atomic_set(&ta->refcount, 0); |
156 | atomic_set(&ta->refcount, 0); |
157 | atomic_set(&ta->lifecount, 0); |
157 | atomic_set(&ta->lifecount, 0); |
158 | ta->context = CONTEXT; |
158 | ta->context = CONTEXT; |
159 | 159 | ||
Line 272... | Line 272... | ||
272 | rc = copy_from_uspace(namebuf, uspace_name, name_len); |
272 | rc = copy_from_uspace(namebuf, uspace_name, name_len); |
273 | if (rc != 0) |
273 | if (rc != 0) |
274 | return (unative_t) rc; |
274 | return (unative_t) rc; |
275 | 275 | ||
276 | namebuf[name_len] = '\0'; |
276 | namebuf[name_len] = '\0'; |
277 | strncpy(TASK->name, namebuf, TASK_NAME_BUFLEN); |
277 | str_cpy(TASK->name, TASK_NAME_BUFLEN, namebuf); |
278 | 278 | ||
279 | return EOK; |
279 | return EOK; |
280 | } |
280 | } |
281 | 281 | ||
282 | /** Find task structure corresponding to task ID. |
282 | /** Find task structure corresponding to task ID. |