Commit Graph

3 Commits

Author SHA1 Message Date
Sven Anderson 46300ecae8 cutil: fix race condition in ptrguard tests
The finalizer of an object is called in a separate go routine, so we
might have to check several times for its completion.

Fixes: #545

Signed-off-by: Sven Anderson <sven@redhat.com>
2021-08-12 10:02:40 -04:00
Sven Anderson 1c72979ce0 ptrguard: assert that //go:uintptrescapes actually works
This adds a test that assures that the special //go:uintptrescapes comment
before the storeUntilRelease() function works as intended, that is the
garbage collector doesn't touch the object referenced by the uintptr until
the function returns after Release() is called.  The test will fail if the
//go:uintptrescapes comment is disabled (removed) or stops working in future
versions of go.

Signed-off-by: Sven Anderson <sven@redhat.com>
2021-03-19 09:47:19 -04:00
Sven Anderson 2bfdee2508 cutil: add test for PtrGuard
Signed-off-by: Sven Anderson <sven@redhat.com>
2021-02-08 14:50:56 +00:00