[foreign-jextract] RFR: Minor change for possible race in shared resource list [v2]

Radoslaw Smogura github.com+7535718+rsmogura at openjdk.java.net
Sat Apr 24 16:14:05 UTC 2021


> (1) One or more threads can see "prev" as CLOSED_LIST. Even those CAS will be performed
> and list head will be set to new cleanup. Than exception is going to be thrown.
> 
> (2) Than cleanup will continue (maybe skipping just added cleanup).
> 
> If in addition, other thread will join in parallel to (1) with cleanup2, than
> queue could look like this HEAD = cleanup2 -> list end marker.

Radoslaw Smogura has updated the pull request incrementally with one additional commit since the last revision:

  Make update of list head (FST) using atomic CAS, because
  `cleanup` method can race with `add` about changing FST.
  
  Small code re-arrangement, to disable double load of FST during first loop pass

-------------

Changes:
  - all: https://git.openjdk.java.net/panama-foreign/pull/519/files
  - new: https://git.openjdk.java.net/panama-foreign/pull/519/files/18960033..21c6c7bb

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=panama-foreign&pr=519&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=panama-foreign&pr=519&range=00-01

  Stats: 11 lines in 1 file changed: 5 ins; 2 del; 4 mod
  Patch: https://git.openjdk.java.net/panama-foreign/pull/519.diff
  Fetch: git fetch https://git.openjdk.java.net/panama-foreign pull/519/head:pull/519

PR: https://git.openjdk.java.net/panama-foreign/pull/519


More information about the panama-dev mailing list