Skip to content

Commit

Permalink
Move ThreadedFFI to its own package and basline, disable ThreadedFFI …
Browse files Browse the repository at this point in the history
…on load
  • Loading branch information
akgrant43 committed Dec 11, 2019
1 parent 0cd76d9 commit d1a6f48
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
7 changes: 4 additions & 3 deletions src/BaselineOfThreadedFFI/BaselineOfThreadedFFI.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ BaselineOfThreadedFFI >> baseline: spec [

spec postLoadDoIt: #reset.

spec
baseline: #ThreadedFFIMigration
with: [ spec repository: 'github://feenkcom/threadedFFI-Plugin' ].

spec
"ThreadedFFI and ThreadedFFIMigration are interdependent,
but ThreadedFFI uses ThreadedFFIMigration during the load"
package: 'ThreadedFFIMigration';
package: 'ThreadedFFI' with: [ spec requires: #('ThreadedFFIMigration') ];
package: 'ThreadedFFI-UFFI' with: [ spec requires: #('ThreadedFFI') ];
package: 'ThreadedFFI-Tests' with: [ spec requires: #('ThreadedFFI') ];
Expand Down
15 changes: 7 additions & 8 deletions src/ThreadedFFIMigration/ThreadedFFIMigration.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Class {
#name : #ThreadedFFIMigration,
#superclass : #Object,
#classVars : [
'DisableThreadedFFI',
'ThreadedFFIAvailable'
'ThreadedFFIAvailable',
'ThreadedFFIEnabled'
],
#category : #ThreadedFFIMigration
}
Expand All @@ -29,15 +29,15 @@ ThreadedFFIMigration class >> disableThreadedFFI [
"Set the flag forcing Threaded FFI to be disabled"
<script>

DisableThreadedFFI := true.
ThreadedFFIEnabled := false.
]

{ #category : #managing }
ThreadedFFIMigration class >> enableThreadedFFI [
"Clear the flag forcing Threaded FFI to be disabled"
<script>

DisableThreadedFFI := false.
ThreadedFFIEnabled := true.
]

{ #category : #private }
Expand All @@ -60,6 +60,7 @@ ThreadedFFIMigration class >> getThreadedFFIAvailable [
{ #category : #'class initialization' }
ThreadedFFIMigration class >> initialize [

self disableThreadedFFI.
SessionManager default
registerSystemClassNamed: self name
atPriority: 20
Expand Down Expand Up @@ -89,8 +90,6 @@ ThreadedFFIMigration class >> startUp: resuming [
ThreadedFFIMigration class >> threadedFFIAvailable [
"Answer a boolean indicating whether to use Threaded FFI"

"If true, DisableThreadedFFI forces Threaded FFI to be NOT used.
Allow for nil value (= false)"
DisableThreadedFFI == true ifTrue: [ ^false ].
^ThreadedFFIAvailable ifNil: [ ThreadedFFIAvailable := self getThreadedFFIAvailable ]
^ThreadedFFIEnabled and: [ ThreadedFFIAvailable
ifNil: [ ThreadedFFIAvailable := self getThreadedFFIAvailable ] ]
]

0 comments on commit d1a6f48

Please sign in to comment.