533 " |
533 " |
534 |
534 |
535 "Modified: 22.3.1997 / 00:56:54 / cg" |
535 "Modified: 22.3.1997 / 00:56:54 / cg" |
536 ! ! |
536 ! ! |
537 |
537 |
|
538 !JavaObject methodsFor:'synchronized evaluation'! |
|
539 |
|
540 freeSynchronizationSemaphore |
|
541 "free synchronizationSemaphore. May be used, to save memory when |
|
542 an object is no longer used synchronized." |
|
543 |
|
544 ^ self shouldNotImplement |
|
545 |
|
546 " |
|
547 self synchronized:[]. |
|
548 self synchronizationSemaphore. |
|
549 self freeSynchronizationSemaphore. |
|
550 " |
|
551 |
|
552 "Created: / 28-01-1997 / 19:31:20 / stefan" |
|
553 "Modified: / 08-12-2013 / 22:21:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
554 ! |
|
555 |
|
556 synchronizationSemaphore |
|
557 "return the synchronization semaphore for myself. |
|
558 subclasses may redefine" |
|
559 |
|
560 ^ self shouldNotImplement |
|
561 |
|
562 " |
|
563 self synchronizationSemaphore |
|
564 " |
|
565 |
|
566 "Modified: / 28-01-1997 / 19:47:09 / stefan" |
|
567 "Modified: / 08-12-2013 / 22:21:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
568 ! |
|
569 |
|
570 synchronizationSemaphore:aSemaphore |
|
571 "set the synchronisationSemaphore for myself. |
|
572 subclasses may redefine this method" |
|
573 |
|
574 ^ self shouldNotImplement |
|
575 |
|
576 "Modified: / 28-01-1997 / 19:37:48 / stefan" |
|
577 "Modified: / 08-12-2013 / 22:21:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
578 ! |
|
579 |
|
580 synchronized:aBlock |
|
581 "Evaluate aBlock synchronized, i.e. use a monitor for this object" |
|
582 |
|
583 %{ |
|
584 extern void __monitorEnter(OBJ obj); |
|
585 __monitorEnter(self); |
|
586 %}. |
|
587 aBlock ensure:[ |
|
588 %{ |
|
589 extern void __monitorExit(OBJ obj); |
|
590 __monitorExit(self); |
|
591 %}. |
|
592 1. "/ To make stc happy (stc needs a return value but primitive code has none) |
|
593 ]. |
|
594 |
|
595 "Modified: / 11-10-2016 / 23:40:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
596 ! ! |
|
597 |
538 !JavaObject methodsFor:'unwind'! |
598 !JavaObject methodsFor:'unwind'! |
539 |
599 |
540 unwindHandlerInContext: aContext |
600 unwindHandlerInContext: aContext |
541 "given a context which has been marked for unwind, |
601 "given a context which has been marked for unwind, |
542 retrieve the handler block. This method is called when ST |
602 retrieve the handler block. This method is called when ST |