Subversion Repositories HelenOS

Rev

Rev 3431 | Rev 4377 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3431 Rev 3597
Line 128... Line 128...
128
}
128
}
129
 
129
 
130
/** Create new task with no threads.
130
/** Create new task with no threads.
131
 *
131
 *
132
 * @param as        Task's address space.
132
 * @param as        Task's address space.
133
 * @param name      Symbolic name.
133
 * @param name      Symbolic name (a copy is made).
134
 *
134
 *
135
 * @return      New task's structure.
135
 * @return      New task's structure.
136
 *
136
 *
137
 */
137
 */
138
task_t *task_create(as_t *as, char *name)
138
task_t *task_create(as_t *as, char *name)
Line 146... Line 146...
146
    task_create_arch(ta);
146
    task_create_arch(ta);
147
 
147
 
148
    spinlock_initialize(&ta->lock, "task_ta_lock");
148
    spinlock_initialize(&ta->lock, "task_ta_lock");
149
    list_initialize(&ta->th_head);
149
    list_initialize(&ta->th_head);
150
    ta->as = as;
150
    ta->as = as;
-
 
151
 
-
 
152
    memcpy(ta->name, name, TASK_NAME_BUFLEN);
151
    ta->name = name;
153
    ta->name[TASK_NAME_BUFLEN - 1] = '\0';
-
 
154
 
152
    atomic_set(&ta->refcount, 0);
155
    atomic_set(&ta->refcount, 0);
153
    atomic_set(&ta->lifecount, 0);
156
    atomic_set(&ta->lifecount, 0);
154
    ta->context = CONTEXT;
157
    ta->context = CONTEXT;
155
 
158
 
156
    ta->capabilities = 0;
159
    ta->capabilities = 0;