From 9b803f2eb8a401ee0ea01da072e611d33d552af5 Mon Sep 17 00:00:00 2001 From: p9ya4sf57 <2573478641@qq.com> Date: Mon, 4 Jul 2022 09:59:02 +0800 Subject: [PATCH] Delete 'pthread.c' --- pthread.c | 66 ------------------------------------------------------- 1 file changed, 66 deletions(-) delete mode 100644 pthread.c diff --git a/pthread.c b/pthread.c deleted file mode 100644 index 5ab9e58..0000000 --- a/pthread.c +++ /dev/null @@ -1,66 +0,0 @@ -#include "pthread.h" - - -/* -* pthread.c -* -* POSIX threads library based on linux-0.11 -* -* Copyright (C) 2008 All rights reserved. -* -* 这个里面没有写多少注释,都是很简单的 -*/ - -_syscall2(int, create_thread, unsigned long, start, void*, arg); -_syscall2(int, syspthread_join, pthread_t, thread, void*, value_ptr); -_syscall1(int, endthread, int, value); - -int pthread_attr_init(pthread_attr_t* attr) /*这个实验没有必要用到这个初始化函数*/ -{ - ;;;;; - return 0; -} -int pthread_create(pthread_t* thread, const pthread_attr_t* attr, void* (*start)(void*), void* arg) -{ - int id = 0; - if (!thread) return EINVAL; - - id = create_thread((unsigned long)start, (int*)arg); - - /*printf("here after create_thread!\n");*/ - /*stop: goto stop;*/ - if (id < 0) return errno; - *thread = id; - return id; -} - -void pthread_exit(void* value_ptr) -{ - endthread((int)value_ptr); -} -int pthread_join(pthread_t thread, void** value_ptr) -{ - syspthread_join(thread, value_ptr); - return 0; -} - - - - - - - - - - - - - - - - - - - - -