Skip to content

rb_mutex_synchronize should pass the return value as-is #3624

@eregon

Description

@eregon

Found by @jeremyevans through:

So in this change, VALUE rb_mutex_synchronize(VALUE mutex, VALUE (*func)(VALUE arg), VALUE arg); is used.
But that function is poorly typed, every VALUE in there should be void* instead, except for VALUE mutex.
That is, both arg and the return value of func can be arbitrary things, not necessary Ruby values/handles.

We already pass arg as-is, but we unwrap+wrap the return value, which I highly suspect is the cause of that error in CI.
So we should remove the unwrap+wrap for rb_mutex_synchronize.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions