Resolved the argument type change of _user- vs. _kern_spawn_thread() - introduced

a new thread_entry_func typedef in the kernel only. Unlike thread_func, it accepts
two arguments - that functionality is not exported to the user, though.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8777 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2004-09-01 15:47:47 +00:00
parent a52018b53b
commit 655c4f0c99
3 changed files with 5 additions and 8 deletions
+1 -6
View File
@@ -54,7 +54,7 @@ int sys_get_next_sem_info(team_id team, uint32 *cookie,
struct sem_info *info, size_t size);
int sys_set_sem_owner(sem_id id, team_id proc);
/* thread syscalls */
/* team & thread syscalls */
extern void _kern_exit(int returnCode);
extern team_id _kern_create_team(const char *path, const char *name, char **args, int argc, char **envp, int envc, int priority);
@@ -62,11 +62,6 @@ extern status_t _kern_kill_team(team_id team);
extern team_id _kern_get_current_team();
extern status_t _kern_wait_for_team(team_id team, status_t *_returnCode);
// XXX: We should decide to either keep the first parameter of the syscall like
// it is (this is what is actually passed) and adjust _user_spawn_thread() to
// do the same or change _kern_spawn_thread() and cast in spawn_thread().
// The magically changing of parameter types between _kern_spawn_thread()
// and _user_spawn_thread() is definitely ugly.
extern thread_id _kern_spawn_thread(int32 (*func)(thread_func, void *),
const char *name, int32 priority, void *data1, void *data2);
extern thread_id _kern_find_thread(const char *name);
+1 -1
View File
@@ -58,7 +58,7 @@ status_t _user_rename_thread(thread_id thread, const char *name);
status_t _user_suspend_thread(thread_id thread);
status_t _user_resume_thread(thread_id thread);
status_t _user_rename_thread(thread_id thread, const char *name);
thread_id _user_spawn_thread(thread_func func, const char *name, int32 priority, void *arg1, void *arg2);
thread_id _user_spawn_thread(thread_entry_func entry, const char *name, int32 priority, void *arg1, void *arg2);
status_t _user_wait_for_thread(thread_id id, status_t *_returnCode);
status_t _user_snooze_etc(bigtime_t timeout, int timebase, uint32 flags);
status_t _user_kill_thread(thread_id thread);
+3 -1
View File
@@ -76,6 +76,8 @@ struct team {
struct arch_team arch_info;
};
typedef int32 (*thread_entry_func)(thread_func, void *);
struct thread {
struct thread *all_next;
struct thread *team_next;
@@ -114,7 +116,7 @@ struct thread {
int32 page_faults_allowed;
/* this field may only stay in debug builds in the future */
thread_func entry;
thread_entry_func entry;
void *args1, *args2;
struct team *team;
status_t return_code;