ncurses 5.9 - patch 20110917
[ncurses.git] / ncurses / base / use_window.c
index 4d0fdf6705be6f05836473c658a2a503c7a071e6..8eb733919848ae7e835978a7c6fd746a8f532c49 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2007,2008 Free Software Foundation, Inc.                   *
+ * Copyright (c) 2007-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: use_window.c,v 1.7 2008/05/03 14:09:38 tom Exp $")
-
-#ifdef USE_PTHREADS
-NCURSES_EXPORT(void)
-_nc_lock_window(const WINDOW *win)
-{
-    WINDOWLIST *p;
-
-    _nc_lock_global(windowlist);
-    for (each_window(p)) {
-       if (&(p->win) == win) {
-           _nc_mutex_lock(&(p->mutex_use_window));
-           break;
-       }
-    }
-}
-
-NCURSES_EXPORT(void)
-_nc_unlock_window(const WINDOW *win)
-{
-    WINDOWLIST *p;
-
-    for (each_window(p)) {
-       if (&(p->win) == win) {
-           _nc_mutex_unlock(&(p->mutex_use_window));
-           break;
-       }
-    }
-    _nc_unlock_global(windowlist);
-}
-#endif
+MODULE_ID("$Id: use_window.c,v 1.9 2009/10/24 22:40:24 tom Exp $")
 
 NCURSES_EXPORT(int)
 use_window(WINDOW *win, NCURSES_WINDOW_CB func, void *data)
 {
     int code = OK;
 
-    T((T_CALLED("use_window(%p,%p,%p)"), win, func, data));
-    _nc_lock_window(win);
+    T((T_CALLED("use_window(%p,%p,%p)"), (void *) win, func, data));
+    _nc_lock_global(curses);
     code = func(win, data);
-    _nc_unlock_window(win);
+    _nc_unlock_global(curses);
 
     returnCode(code);
 }