source change for consistency

This commit is contained in:
hyunghwan.chung 2019-09-14 02:21:59 +00:00
parent c3c5365fcf
commit d2f5446ee5
4 changed files with 30 additions and 8 deletions

View File

@ -297,7 +297,7 @@ class SemaphoreHeap(Object)
| top |
top := self.arr at: 0.
self deleteAt: 0.
self removeAt: 0.
^top
}
@ -314,7 +314,7 @@ class SemaphoreHeap(Object)
^if (aSemaphore youngerThan: item) { self siftUp: anIndex } else { self siftDown: anIndex }.
}
method deleteAt: anIndex
method removeAt: anIndex
{
| item xitem |

View File

@ -13,6 +13,7 @@ class System(Apex)
var(#class) asyncsg.
var(#class) gcfin_sem.
var(#class) gcfin_should_exit := false.
var(#class) shr.
pooldic Log
{
@ -28,6 +29,16 @@ class System(Apex)
FATAL := 16.
}
method(#class) _initialize
{
self.shr := Dictionary new.
}
method(#class) _cleanup
{
self.shr := nil.
}
method(#class) addAsyncSemaphore: sem
{
^self.asyncsg addSemaphore: sem
@ -55,6 +66,8 @@ class System(Apex)
self error: ('Cannot find the class - ' & class_name).
}.
self _initialize.
// start the gc finalizer process and os signal handler process
//[ self __gc_finalizer ] fork.
//[ self __os_sig_handler ] fork.
@ -70,7 +83,6 @@ class System(Apex)
]
ensure: [
self _setSig: 16rFF.
//// System logNl: '======= END of startup ==============='.
].
^ret.
@ -206,6 +218,7 @@ class System(Apex)
self.gcfin_sem signal. // wake the gcfin process.
self _halting. // inform VM that it should get ready for halting.
self _cleanup.
].
}
@ -224,6 +237,15 @@ class System(Apex)
method(#class,#primitive) return: object to: context.
// =======================================================================================
method(#class) registerSignalHandler: block
{
self.shr add: block.
}
method(#class) removeSignalHandler: block
{
}
method(#class) sleepForSecs: secs
{
// -----------------------------------------------------

View File

@ -77,9 +77,9 @@ class MyObject(Object)
].
'--------------------------' dump.
sempq deleteAt: 40.
sempq deleteAt: 50.
sempq deleteAt: 100.
sempq removeAt: 40.
sempq removeAt: 50.
sempq removeAt: 100.
a := -100.
[sempq size > 0] whileTrue: [

View File

@ -227,8 +227,8 @@ class MyObject(TestObject)
].
'--------------------------' dump.
sempq deleteAt: 40.
sempq deleteAt: 50.
sempq removeAt: 40.
sempq removeAt: 50.
[sempq size > 0] whileTrue: [
| sem |