}
-#ifndef G_OS_WIN32
-
static void
g_cancellable_write_cancelled (GCancellable *cancellable)
{
+#ifdef G_OS_WIN32
+ if (priv->event)
+ SetEvent (priv->event);
+#else
gssize c;
GCancellablePrivate *priv;
const char ch = 'x';
priv = cancellable->priv;
+
if (priv->cancel_pipe[0] == -1)
return;
do
c = write (priv->cancel_pipe[1], &ch, 1);
while (c == -1 && errno == EINTR);
+#endif
}
+#ifndef G_OS_WIN32
+
static void
g_cancellable_open_pipe (GCancellable *cancellable)
{
priv->cancelled = TRUE;
priv->cancelled_running = TRUE;
-#ifdef G_OS_WIN32
- if (priv->event)
- SetEvent (priv->event);
-#endif
g_cancellable_write_cancelled (cancellable);