Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Commit

Permalink
using variable to reference pointer (to update pointer immediately)
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanlm committed Nov 6, 2019
1 parent 4274024 commit 6d13db7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ThreadedFFI/TFPool.class.st
Expand Up @@ -102,10 +102,14 @@ TFPool >> takeOne [
| element |

^ mutex critical: [
| index |

self isOverflown
ifTrue: [ self growBy: self growRate ].
element := elements at: pointer.
elements at: pointer put: nil.

index := pointer.
pointer := pointer + 1.
element := elements at: index.
elements at: index put: nil.
element ]
]

0 comments on commit 6d13db7

Please sign in to comment.