Changeset 480 for trunk/Include/Classes/System/Threading/Thread.ab
- Timestamp:
- Mar 15, 2008, 3:34:56 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/Classes/System/Threading/Thread.ab
r400 r480 30 30 throwingParamObject As Object 31 31 32 needFreeStructurePointers As *VoidPtr 33 countOfNeedFreeStructurePointers As Long 34 32 35 Public 33 36 Sub Thread() … … 127 130 '------------ 128 131 132 ' 構造体の一時メモリ退避用領域を作成 133 needFreeStructurePointers = _System_malloc( 1 ) 134 countOfNeedFreeStructurePointers = 0 135 129 136 'GCにスレッド開始を通知 130 137 _System_pobj_AllThreads->BeginThread(This, _System_GetSp() As *LONG_PTR) … … 143 150 'GCにスレッド終了を通知 144 151 _System_pobj_AllThreads->EndThread(This) 152 153 ' 構造体の一時メモリ退避用領域を破棄 154 _System_free( needFreeStructurePointers ) 145 155 146 156 '自身のスレッドハンドルを閉じる … … 189 199 Return throwingParamObject 190 200 End Function 201 202 Sub __AddNeedFreeTempStructure( structurePointer As VoidPtr ) 203 needFreeStructurePointers = _System_realloc( needFreeStructurePointers, ( countOfNeedFreeStructurePointers + 1 ) * SizeOf(VoidPtr) ) 204 needFreeStructurePointers[countOfNeedFreeStructurePointers] = structurePointer 205 countOfNeedFreeStructurePointers ++ 206 End Sub 207 208 Sub __FreeTempStructure() 209 Dim i = 0 As Long 210 While i<countOfNeedFreeStructurePointers 211 free( needFreeStructurePointers[i] ) 212 i++ 213 Wend 214 countOfNeedFreeStructurePointers = 0 215 End Sub 191 216 192 217 … … 389 414 390 415 End Namespace 'Detail 416 417 Sub _System_AddNeedFreeTempStructure( structurePointer As VoidPtr ) 418 Thread.CurrentThread.__AddNeedFreeTempStructure( structurePointer ) 419 End Sub 420 Sub _System_FreeTempStructure() 421 Thread.CurrentThread.__FreeTempStructure() 422 End Sub
Note:
See TracChangeset
for help on using the changeset viewer.