lkml.org 
[lkml]   [1998]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectInitializing non-static locks
Date
I hit this problem in my driver. The way I solved it was to make a
static variable
rwlock_t rw_lock_unlocked = RW_LOCK_UNLOCKED;

Then use rw_lock_unlocked instead of RW_LOCK_UNLOCKED. Maybe that is an
idea for the kernel?

Bill.

> The problem is that it is not an initialization but an asignment.
> Then gcc barfs and stops on error; because you can not use = to asign
> a structure...(gcc-2.7.2.3)
>
> On 27-Oct-98 Horst von Brand wrote:
> > "Manuel J. Galan" <manolow@step.es> said:
> >> - tmp->cad_lock = RW_LOCK_UNLOCKED;
> >> + memcpy (&tmp->cad_lock, &tmp_rw_lock, sizeof (tmp_rw_lock));


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:45    [W:0.043 / U:0.904 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site