[Mono-dev] Patch for io-layer/collection.c

Koushik K. Dutta koush at koushikdutta.com
Mon May 11 18:35:06 EDT 2009


Android's build uses the GNU C compiler, but is failing while compiling "gpointer collection_thread (gpointer unused G_GNUC_UNUSED)" because it exits via a pthread_exit, and not via the return statement:

static gpointer collection_thread (gpointer unused G_GNUC_UNUSED)
{
    struct timespec sleepytime;

    sleepytime.tv_sec = _WAPI_HANDLE_COLLECTION_UPDATE_INTERVAL;
    sleepytime.tv_nsec = 0;

    while (_wapi_has_shut_down == FALSE) {
        nanosleep (&sleepytime, NULL);

        //_wapi_handle_dump ();
        _wapi_handle_update_refs ();

        /* This is an abuse of the collection thread, but it's
         * better than creating a new thread just for one more
         * function.
         */
        _wapi_process_reap ();
    }

    pthread_exit (NULL);

#if !defined(__GNUC__)
    /* Even though we tell gcc that this function doesn't return,
     * other compilers won't see that.
     */
    return(NULL);
#endif
}

I've attached a patch that fixes the Android build by adding another condition to the #if.

Koush
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090511/049de959/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: collection.c.patch
Type: application/octet-stream
Size: 454 bytes
Desc: collection.c.patch
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090511/049de959/attachment.obj 


More information about the Mono-devel-list mailing list