aboutsummaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-05-17 22:16:02 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-05-17 22:16:02 +0000
commit3d0f071c607bfdcdf89f8ec2c06b8596c6610282 (patch)
tree166f99f4788c23b3649826405468b34f475d4726 /nuttx/include
parent7c97dbdf4411e96682a56267b4c095574dfe604d (diff)
downloadpx4-firmware-3d0f071c607bfdcdf89f8ec2c06b8596c6610282.tar.gz
px4-firmware-3d0f071c607bfdcdf89f8ec2c06b8596c6610282.tar.bz2
px4-firmware-3d0f071c607bfdcdf89f8ec2c06b8596c6610282.zip
Implement an NX interface to block flush message queues in multi-user mode. This is necessary to prevent stale window handles when a window is closed
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4745 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/include')
-rw-r--r--nuttx/include/nuttx/nx/nx.h63
-rw-r--r--nuttx/include/nuttx/nx/nxtk.h33
2 files changed, 96 insertions, 0 deletions
diff --git a/nuttx/include/nuttx/nx/nx.h b/nuttx/include/nuttx/nx/nx.h
index bba098398..4a228de25 100644
--- a/nuttx/include/nuttx/nx/nx.h
+++ b/nuttx/include/nuttx/nx/nx.h
@@ -190,6 +190,36 @@ struct nx_callback_s
#ifdef CONFIG_NX_KBD
void (*kbdin)(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch, FAR void *arg);
#endif
+
+ /**************************************************************************
+ * Name: blocked
+ *
+ * Descripton:
+ * This callback is the response from nx_block (or nxtk_block). Those
+ * blocking interfaces are used to assure that no further messages are
+ * directed to the window. Receipt of the blocked callback signifies
+ * that (1) there are no further pending callbacks and (2) that the
+ * window is now 'defunct' and will receive no further callbacks.
+ *
+ * This callback supports coordinated destruction of a window in multi-
+ * user mode. In multi-use mode, the client window logic must stay
+ * intact until all of the queued callbacks are processed. Then the
+ * window may be safely closed. Closing the window prior with pending
+ * callbacks can lead to bad behavior when the callback is executed.
+ *
+ * Input Parameters:
+ * hwnd - Window handle of the blocked window
+ * arg - User provided argument (see nx_openwindow, nx_requestbkgd,
+ * nxtk_openwindow, or nxtk_opentoolbar)
+ *
+ * Returned Value:
+ * None
+ *
+ **************************************************************************/
+
+#ifdef CONFIG_NX_MULTIUSER
+ void (*blocked)(NXWINDOW hwnd, FAR void *arg);
+#endif
};
/****************************************************************************
@@ -435,6 +465,39 @@ EXTERN NXWINDOW nx_openwindow(NXHANDLE handle,
EXTERN int nx_closewindow(NXWINDOW hwnd);
/****************************************************************************
+ * Name: nx_block
+ *
+ * Description:
+ * This is callback will do to things: (1) any queue a 'blocked' callback
+ * to the window and then (2) block any further window messaging.
+ *
+ * The 'blocked' callback is the response from nx_block (or nxtk_block).
+ * Those blocking interfaces are used to assure that no further messages are
+ * are directed to the window. Receipt of the blocked callback signifies
+ * that (1) there are no further pending callbacks and (2) that the
+ * window is now 'defunct' and will receive no further callbacks.
+ *
+ * This callback supports coordinated destruction of a window in multi-
+ * user mode. In multi-use more, the client window logic must stay
+ * intact until all of the queued callbacks are processed. Then the
+ * window may be safely closed. Closing the window prior with pending
+ * callbacks can lead to bad behavior when the callback is executed.
+ *
+ * Multiple user mode only!
+ *
+ * Input Parameters:
+ * wnd - The window to be blocked
+ *
+ * Return:
+ * OK on success; ERROR on failure with errno set appropriately
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_NX_MULTIUSER
+EXTERN int nx_block(NXWINDOW hwnd);
+#endif
+
+/****************************************************************************
* Name: nx_requestbkgd
*
* Description:
diff --git a/nuttx/include/nuttx/nx/nxtk.h b/nuttx/include/nuttx/nx/nxtk.h
index 00bce82e6..a69d17775 100644
--- a/nuttx/include/nuttx/nx/nxtk.h
+++ b/nuttx/include/nuttx/nx/nxtk.h
@@ -151,6 +151,39 @@ EXTERN NXTKWINDOW nxtk_openwindow(NXHANDLE handle,
EXTERN int nxtk_closewindow(NXTKWINDOW hfwnd);
/****************************************************************************
+ * Name: nxtk_block
+ *
+ * Description:
+ * This is callback will do to things: (1) any queue a 'blocked' callback
+ * to the window and then (2) block any further window messaging.
+ *
+ * The 'blocked' callback is the response from nx_block (or nxtk_block).
+ * Those blocking interfaces are used to assure that no further messages are
+ * are directed to the window. Receipt of the blocked callback signifies
+ * that (1) there are no further pending callbacks and (2) that the
+ * window is now 'defunct' and will receive no further callbacks.
+ *
+ * This callback supports coordinated destruction of a window in multi-
+ * user mode. In multi-use mode, the client window logic must stay
+ * intact until all of the queued callbacks are processed. Then the
+ * window may be safely closed. Closing the window prior with pending
+ * callbacks can lead to bad behavior when the callback is executed.
+ *
+ * Multiple user mode only!
+ *
+ * Input Parameters:
+ * hfwnd - The window to be blocked
+ *
+ * Return:
+ * OK on success; ERROR on failure with errno set appropriately
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_NX_MULTIUSER
+EXTERN int nxtk_block(NXTKWINDOW hfwnd);
+#endif
+
+/****************************************************************************
* Name: nxtk_getposition
*
* Description: