mirror of
https://github.com/drasko/codezero.git
synced 2026-01-15 20:33:16 +01:00
Fixed fork() errors where forked thread is a copy of any cloned thread in parent address space.
Upon fork, child was created in a new space but as a copy of any cloned thread in the parent space. This was due to the search of forker thread by its space id (which is shared among many cloned threads). Now fixed. modified: src/api/thread.c modified: tasks/mm0/src/task.c
This commit is contained in:
@@ -309,7 +309,7 @@ int thread_create(struct task_ids *ids, unsigned int flags)
|
||||
return -ENOMEM;
|
||||
|
||||
if (flags == THREAD_SAME_SPACE || flags == THREAD_COPY_SPACE) {
|
||||
if (!(orig_task = tcb_find_by_space(ids->spid))) {
|
||||
if (!(orig_task = tcb_find(ids->tid))) {
|
||||
/* Pre-mature tcb needs freeing by free_page */
|
||||
free_page(new);
|
||||
return -EINVAL;
|
||||
|
||||
Reference in New Issue
Block a user