Changeset 249
- Timestamp:
- May 15, 2007, 2:44:41 AM (18 years ago)
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/Threading/Thread.ab
r237 r249 44 44 End Sub 45 45 46 Sub Thread( ByRefobj As Thread)46 Sub Thread(obj As Thread) 47 47 m_hThread=obj.m_hThread 48 48 m_dwThreadId=obj.m_dwThreadId … … 151 151 152 152 Static Function CurrentThread() As Thread 153 Dim obj_Thread As Thread() 154 _System_pobj_AllThreads->CurrentThread(obj_Thread) 155 Return obj_Thread 153 Return _System_pobj_AllThreads->CurrentThread() 156 154 End Function 157 155 End Class … … 311 309 312 310 'カレントスレッドを取得 313 Function CurrentThread( ByRef obj_Thread As Thread) As Boolean311 Function CurrentThread() As Thread 314 312 Dim dwNowThreadId As DWord 315 313 dwNowThreadId=GetCurrentThreadId() … … 318 316 For i=0 To ELM(ThreadNum) 319 317 If ppobj_Thread[i]->ThreadId=dwNowThreadId Then 320 obj_Thread.Thread(ByVal ppobj_Thread[i]) 321 Return True 322 End If 323 Next 324 325 Return False 318 Return ByVal ppobj_Thread[i] 319 End If 320 Next 321 322 ' TODO: エラー処理 323 OutputDebugString( "カレントスレッドの取得に失敗" ) 324 debug 326 325 End Function 327 326 -
Include/system/exception.ab
r237 r249 5 5 Const AddressOfCatch As VoidPtr 6 6 Const StackPtr As LONG_PTR 7 context As CONTEXT 8 Const debugProcNum As DWord 7 9 8 10 Sub TryLayer( AddressOfCatch As VoidPtr, StackPtr As LONG_PTR ) 9 11 This.AddressOfCatch = AddressOfCatch 10 12 This.StackPtr = StackPtr 13 14 context.ContextFlags=CONTEXT_ALL 15 If Thread.CurrentThread().__GetContext(context) = 0 Then 16 ' TODO: エラー処理 17 debug 18 End If 19 20 #ifdef _DEBUG 21 Dim ThreadNum As Long 22 ThreadNum=_DebugSys_GetThread() 23 If ThreadNum <> -1 Then 24 debugProcNum = _DebugSys_ProcNum[ThreadNum] 25 End If 26 #endif 11 27 End Sub 12 28 Sub ~TryLayer() … … 37 53 38 54 'Try 39 Sub BeginTryScope( AddressOfCatch As VoidPtr, StackPtr As LONG_PTR )55 Function BeginTryScope( AddressOfCatch As VoidPtr, StackPtr As LONG_PTR ) As TryLayer 40 56 ppTryLayers = _System_realloc( ppTryLayers, ( nTryLayers + 1 ) * SizeOf( *TryLayer ) ) 41 57 ppTryLayers[nTryLayers] = New TryLayer( AddressOfCatch, StackPtr ) 42 58 nTryLayers++ 43 End Sub 59 60 Return ByVal ppTryLayers[nTryLayers-1] 61 End Function 44 62 45 63 'End Try … … 55 73 56 74 'TODO: 適切なエラー処理 75 MessageBox( NULL, "例外", "", MB_OK or MB_ICONEXCLAMATION ) 57 76 58 77 Return … … 72 91 73 92 'レジスタ情報を取得 74 Dim context As CONTEXT 75 FillMemory(VarPtr(context),SizeOf(CONTEXT),0) 76 context.ContextFlags=CONTEXT_CONTROL 77 If thread.__GetContext( context ) = 0 Then 78 OutputDebugString(Ex"レジスタ情報の取得に失敗しました。\r\n") 79 Return 80 End If 81 93 Dim context = ppTryLayers[nTryLayers - 1]->context 94 debug 82 95 '新しいip, spをセット 83 96 #ifdef _WIN64 84 97 context.Rip = ppTryLayers[nTryLayers - 1]->AddressOfCatch As QWord 85 context.Rsp = ppTryLayers[nTryLayers - 1]->StackPtr98 'context.Rsp = ppTryLayers[nTryLayers - 1]->StackPtr 86 99 #else 87 100 context.Eip = ppTryLayers[nTryLayers - 1]->AddressOfCatch As DWord 88 101 context.Esp = ppTryLayers[nTryLayers - 1]->StackPtr 89 102 #endif 103 104 #ifdef _DEBUG 105 Dim ThreadNum As Long 106 ThreadNum=_DebugSys_GetThread() 107 If ThreadNum <> -1 Then 108 _DebugSys_ProcNum[ThreadNum] = ppTryLayers[nTryLayers - 1]->debugProcNum-1 109 End If 110 #endif 111 90 112 If thread.__SetContext( context ) = 0 Then 91 113 OutputDebugString(Ex"レジスタ情報の設定に失敗しました。\r\n") -
Include/system/gc.sbp
r237 r249 288 288 If pdwFlags[index] and _System_GC_FLAG_OBJECT Then 289 289 ' オブジェクトの場合 290 If ScanObject( (ppPtr[index] + 3*SizeOf(LONG_PTR)) As *Object, pbMark) = False Then290 If ScanObject( (ppPtr[index] + 4*SizeOf(LONG_PTR)) As *Object, pbMark) = False Then 291 291 Dim maxNum = (pSize[index]\SizeOf(LONG_PTR)) As Long 292 292 Scan(ppPtr[index] As *LONG_PTR, maxNum, pbMark) … … 371 371 ・オブジェクトのサイズ 372 372 ・デストラクタの関数ポインタ 373 ・リザーブ領域 373 374 を考慮 */ 374 _System_SweepingDelete (ptr + SizeOf( LONG_PTR ) * 3)375 _System_SweepingDelete (ptr + SizeOf( LONG_PTR ) * 4 ) 375 376 Else 376 377 HeapFree(_System_hProcessHeap,0,ptr)
Note:
See TracChangeset
for help on using the changeset viewer.