Re: How to do proper locking
From: Ian Dowse (iedowse_at_iedowse.com)
Date: 08/06/05
- Previous message: Philip S. Schulz: "Re: pthreads problem"
- In reply to: Hans Petter Selasky: "Re: How to do proper locking"
- Next in thread: Hans Petter Selasky: "Re: How to do proper locking"
- Reply: Hans Petter Selasky: "Re: How to do proper locking"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: hselasky@c2i.net Date: Sat, 06 Aug 2005 17:02:16 +0100
In message <200508060139.57143.hselasky@c2i.net>, Hans Petter Selasky writes:
>Yes, you are right, but the problem is, that for most callback systems in the
>kernel, there is no mechanism that will pre-lock some custom mutex before
>calling the callback.
>
>I am not speaking about adding lines to existing code, but to add one extra
>parameter to the setup functions, where the mutex that should be locked
>before calling the callback(s) can be specified. If it is NULL, Giant will be
>used.
>
>The setup functions I have in mind are for example: "make_dev()",
>"bus_setup_intr()", "callout_reset()" ... and in general all callback systems
>that look like these.
Note that FreeBSD's callout subsystem does already have such a
mechanism. Just use callout_init_mtx() and the specified mutex will
be acquired before the callback is invoked. See callout(9) for more
details.
Ian
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
- Previous message: Philip S. Schulz: "Re: pthreads problem"
- In reply to: Hans Petter Selasky: "Re: How to do proper locking"
- Next in thread: Hans Petter Selasky: "Re: How to do proper locking"
- Reply: Hans Petter Selasky: "Re: How to do proper locking"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|