http://defect.opensolaris.org/bz/show_bug.cgi?id=8390
--- Comment #5 from Michael Hunter <michael.hunter at sun.com> 2009-04-23
17:51:22 ---
Sorry I sent you info about the object list locking issue.
The object locking issue can be simply fixed via the following few lines.
I'm not sure if you've signed off for the day yet or not. I'll put these and
my other fixes back before the end of the day if I don't hear from you.
@@ -229,7 +242,8 @@
void *data)
{
nwamd_object_t object;
- struct nwamd_object_list object_list = nwamd_get_object_list(type);
+ pthread_mutexattr_t attr;
+ struct nwamd_object_list *object_list = nwamd_get_object_list(type);
object = calloc(1, sizeof (struct nwamd_object));
if (object == NULL)
@@ -242,7 +256,10 @@
object->object_type = type;
object->object_state = NWAM_STATE_INITIALIZED;
- if (pthread_mutex_init(&object->object_mutex, NULL) == -1) {
+ (void) pthread_mutexattr_init(&attr);
+ (void) pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+
+ if (pthread_mutex_init(&object->object_mutex, &attr) == -1) {
nlog(LOG_ERR, "pthread_mutex_init failed: %s",
strerror(errno));
free(object);
return (NULL);
--
Configure bugmail: http://defect.opensolaris.org/bz/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.