Skip to content

core: mutex_t::val could memorize holding thread id, not a boolean #4494

@Kijewski

Description

@Kijewski

For debugging purposes it would be nice if mutex_t::val stored the current thread id, not a boolean. The test if the mutex is held would remain the same: mutex_t::val == 0mutex_t::val == KERNEL_PID_UNDEF (KERNEL_PID_UNDEF == 0), so I see no extra overhead. The locking would be no more difficult either: atomic_set_to_one(&mutex.val)(which uses atomic_cas) → atomic_cas(&mutex.val, KERNEL_PID_UNDEF, sched_active_pid).

Metadata

Metadata

Assignees

Labels

Area: coreArea: RIOT kernel. Handle PRs marked with this with care!Discussion: RFCThe issue/PR is used as a discussion starting point about the item of the issue/PR

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions