Details
- Reviewers
cperciva
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 13641
Event Timeline
(Continuing on from the email thread:)
Can you explain what you mean by safe?
DEFINE_MUTEX() is simply a wrapper for another SYSINIT. It has nothing to do with the function it is placed inside.
DEFINE_MUTEX is a wrapper for SYSINIT, and SYSINIT creates some structures, one of which is declared to be placed in the "set_sysinit_set" segment. Since the concept of placing symbols into different segments is not specified in either the C or POSIX standards, I don't know if there's any guarantee that function-scope symbols can be declared as being located in specific segments.
In any event, I've changed my WIP so that it doesn't break here, so there's no immediate problem; this is just a concern about the possibility of things breaking in the future.
Hi,
Try to look at the generated assembly code from the compiler. The section attributes should be clearly marked in the output.
Anyway, having the "static" outside the function is more clean code wise.
--HPS