|
From: <enl...@li...> - 2001-05-04 01:58:06
|
Enlightenment CVS committal
Author : rbdpngn
Project : e17
Module : libs/ewd
Dir : e17/libs/ewd/src
Modified Files:
ewd_list.c ewd_threads.h
Log Message:
A few fixes that sfire helped track down.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewd/src/ewd_list.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- ewd_list.c 2001/05/03 21:49:03 1.6
+++ ewd_list.c 2001/05/04 01:58:05 1.7
@@ -587,11 +587,15 @@
node = list->first;
EWD_READ_LOCK_STRUCT(node);
while (node && node->data) {
+ Ewd_List_Node *next;
+
if (node->data == data)
break;
+
+ next = node->next;
EWD_READ_UNLOCK_STRUCT(node);
- node = node->next;
+ node = next;
EWD_READ_LOCK_STRUCT(node);
index++;
@@ -678,6 +682,8 @@
{
void *ret;
+ CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
EWD_READ_LOCK_STRUCT(list);
ret = _ewd_list_current(list);
EWD_READ_UNLOCK_STRUCT(list);
@@ -690,8 +696,6 @@
{
void *ret;
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
-
if (!list->current)
return NULL;
@@ -711,6 +715,8 @@
{
void *data;
+ CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+
EWD_WRITE_LOCK_STRUCT(list);
data = _ewd_list_next(list);
EWD_WRITE_UNLOCK_STRUCT(list);
@@ -723,25 +729,22 @@
{
void *data;
Ewd_List_Node *ret;
-
- CHECK_PARAM_POINTER_RETURN("list", list, FALSE);
+ Ewd_List_Node *next;
if (!list->current)
return NULL;
EWD_READ_LOCK_STRUCT(list->current);
- if (list->current == list->current->next)
- return NULL;
-
ret = list->current;
+ next = list->current->next;
EWD_READ_UNLOCK_STRUCT(list->current);
- list->current = list->current->next;
+ list->current = next;
list->index++;
- EWD_WRITE_LOCK_STRUCT(ret);
+ EWD_READ_LOCK_STRUCT(ret);
data = ret->data;
- EWD_WRITE_UNLOCK_STRUCT(ret);
+ EWD_READ_UNLOCK_STRUCT(ret);
return data;
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewd/src/ewd_threads.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ewd_threads.h 2001/05/02 22:58:02 1.4
+++ ewd_threads.h 2001/05/04 01:58:05 1.5
@@ -1,7 +1,7 @@
#ifndef _EWD_THREADS_H
#define _EWD_THREADS_H
-#undef HAVE_PTHREADS
+/* #undef HAVE_PTHREADS */
#ifdef HAVE_PTHREADS /* pthreads are installed */
|