- Timestamp:
- Jun 1, 2008, 11:35:04 PM (16 years ago)
- File:
-
- 1 edited
-
branches/win64/lisp-kernel/thread_manager.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/win64/lisp-kernel/thread_manager.c
r9557 r9653 59 59 extern void interrupt_handler(int, siginfo_t *, ExceptionInformation *); 60 60 61 BOOL (*pCancelIoEx)(HANDLE, OVERLAPPED*) = NULL; 62 63 64 extern void *windows_find_symbol(void*, char*); 65 61 66 int 62 67 raise_thread_interrupt(TCR *target) … … 69 74 area *cs = target->cs_area, *ts = target->cs_area; 70 75 DWORD rc; 76 BOOL io_pending; 71 77 72 78 pcontext = (CONTEXT *)((((natural)&_contextbuf)+15)&~15); … … 82 88 wperror("GetThreadContext"); 83 89 } 90 84 91 where = (pc)(xpPC(pcontext)); 85 92 … … 97 104 /* If the thread's in a blocking syscall, it'd be nice to 98 105 get it out of that state here. */ 106 GetThreadIOPendingFlag(hthread,&io_pending); 99 107 target->interrupt_pending = (1LL << (nbits_in_word - 1LL)); 100 108 ResumeThread(hthread); 109 if (io_pending) { 110 pending_io * pending = (pending_io *) (target->foreign_exception_status); 111 if (pCancelIoEx) { 112 pCancelIoEx(pending->h, pending->o); 113 } else { 114 CancelIo(pending->h); 115 } 116 } 101 117 return 0; 102 118 } else { … … 104 120 so that it calls out and then returns to the context, 105 121 handling any necessary pc-lusering. */ 106 LispObj foreign_rsp = (((LispObj)(target->foreign_sp))- 128)&~15;122 LispObj foreign_rsp = (((LispObj)(target->foreign_sp))-0x200)&~15; 107 123 CONTEXT *icontext = ((CONTEXT *) foreign_rsp) -1; 108 124 icontext = (CONTEXT *)(((LispObj)icontext)&~15); … … 1154 1170 #ifdef WINDOWS 1155 1171 lisp_global(TCR_KEY) = TlsAlloc(); 1172 pCancelIoEx = windows_find_symbol(NULL, "CancelIoEx"); 1156 1173 #else 1157 1174 pthread_key_create((pthread_key_t *)&(lisp_global(TCR_KEY)), shutdown_thread_tcr);
Note:
See TracChangeset
for help on using the changeset viewer.
