* src/toolbox/list.c (list_free): New function.
[cacao.git] / src / toolbox / list.c
index 720621e55b0e3823c53de29669e5bbe90fa97382..3f35eb4a48bd7165983dab8a15630b4a5620d801 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "config.h"
 
+#include <assert.h>
 #include <stdlib.h>
 
 #include "vm/types.h"
@@ -61,6 +62,20 @@ list_t *list_create(s4 nodeoffset)
 }
 
 
+/* list_free *******************************************************************
+
+   Free a list.
+
+*******************************************************************************/
+
+void list_free(list_t *l)
+{
+       assert(l != NULL);
+
+       FREE(l, list_t);
+}
+
+
 /* list_create_dump ************************************************************
 
    Allocates a new list on the dump memory.
@@ -84,6 +99,30 @@ list_t *list_create_dump(s4 nodeoffset)
 }
 
 
+/* list_lock *******************************************************************
+
+   Locks the list.
+
+*******************************************************************************/
+
+void list_lock(list_t *l)
+{
+       LOCK_MONITOR_ENTER(l);
+}
+
+
+/* list_unlock *****************************************************************
+
+   Unlocks the list.
+
+*******************************************************************************/
+
+void list_unlock(list_t *l)
+{
+       LOCK_MONITOR_EXIT(l);
+}
+
+
 /* list_add_first **************************************************************
 
    Adds the element as first element.