From 2307a5f967fea6b7629a300ee98e98bfc836a0ea Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Tue, 11 Apr 1995 05:17:11 +0000 Subject: [PATCH] Add new procedure OS2_current_tid. --- v7/src/microcode/os2thrd.c | 20 +++++++++++++------- v7/src/microcode/os2thrd.h | 5 +++-- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/v7/src/microcode/os2thrd.c b/v7/src/microcode/os2thrd.c index d62f2f5e9..157acb8f0 100644 --- a/v7/src/microcode/os2thrd.c +++ b/v7/src/microcode/os2thrd.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: os2thrd.c,v 1.1 1994/11/28 03:43:00 cph Exp $ +$Id: os2thrd.c,v 1.2 1995/04/11 05:17:03 cph Exp $ -Copyright (c) 1994 Massachusetts Institute of Technology +Copyright (c) 1994-95 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -74,6 +74,16 @@ OS2_kill_thread (TID tid) STD_API_CALL (dos_kill_thread, (tid)); } +TID +OS2_current_tid (void) +{ + PTIB ptib; + PPIB ppib; + TID tid; + STD_API_CALL (dos_get_info_blocks, ((&ptib), (&ppib))); + return (ptib -> tib_ptib2 -> tib2_ultid); +} + #ifndef __IBMC__ #define MAX_TID 999 static thread_store_t * thread_store_array [MAX_TID + 1]; @@ -81,11 +91,7 @@ static thread_store_t * thread_store_array [MAX_TID + 1]; thread_store_t ** OS2_threadstore (void) { - PTIB ptib; - PPIB ppib; - TID tid; - STD_API_CALL (dos_get_info_blocks, ((&ptib), (&ppib))); - tid = (ptib -> tib_ptib2 -> tib2_ultid); + TID tid = (OS2_thread_id ()); if (tid > MAX_TID) OS2_logic_error ("Unexpectedly large TID."); return (& (thread_store_array [tid])); diff --git a/v7/src/microcode/os2thrd.h b/v7/src/microcode/os2thrd.h index a8af33d58..8d9638bfa 100644 --- a/v7/src/microcode/os2thrd.h +++ b/v7/src/microcode/os2thrd.h @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: os2thrd.h,v 1.1 1994/11/28 03:43:01 cph Exp $ +$Id: os2thrd.h,v 1.2 1995/04/11 05:17:11 cph Exp $ -Copyright (c) 1994 Massachusetts Institute of Technology +Copyright (c) 1994-95 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -70,6 +70,7 @@ typedef msg_t sm_kill_request_t; extern TID OS2_beginthread (thread_procedure_t, void *, unsigned int); extern void OS2_endthread (void); extern void OS2_kill_thread (TID); +extern TID OS2_current_tid (void); #ifdef __IBMC__ #define OS2_threadstore() ((thread_store_t **) (_threadstore ())) -- 2.25.1