On Mon, 2014-03-24 at 00:22 +0100, Joël Krähemann wrote: > On Mon, 2014-03-24 at 00:20 +0100, Joël Krähemann wrote: > > https://sourceforge.net/p/ags/code/1515/tree/src/ags/thread/ags_returnable_thread.c > > > > _______________________________________________ > > gtk-app-devel-list mailing list > > gtk-app-devel-list@gnome.org > > https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list > > Hi, I'd like to use g_atomic_pointer_set and g_atomic_pointer_get but > obtaining compile error. First the struct containing void * > > > struct _AgsReturnableThread > { > AgsThread thread; > > volatile guint flags; > > volatile void *safe_data; > }; > > > (gdb) r > Starting program: /home/joel/ags-code/ags > warning: Could not load shared library symbols for linux-vdso.so.1. > Do you need "set solib-search-path" or "set sysroot"? > [Thread debugging using libthread_db enabled] > Using host libthread_db library > "/lib/x86_64-linux-gnu/libthread_db.so.1". > [New Thread 0x7fffe630a700 (LWP 5175)] > [New Thread 0x7fffe5aa9700 (LWP 5176)] > [New Thread 0x7fffe52a8700 (LWP 5177)] > [New Thread 0x7fffe4aa7700 (LWP 5178)] > [New Thread 0x7fffdffff700 (LWP 5179)] > [New Thread 0x7fffdf7fe700 (LWP 5180)] > [New Thread 0x7fffdeffd700 (LWP 5181)] > [New Thread 0x7fffde7fc700 (LWP 5182)] > [New Thread 0x7fffddffb700 (LWP 5183)] > [New Thread 0x7fffdd7fa700 (LWP 5184)] > [New Thread 0x7fffdcff9700 (LWP 5185)] > ** Message: AgsRecallFactory creating: ags-delay > ** Message: AgsRecallFactory creating: ags-count-beats > ** Message: ags_channel_nth: > nth channel does not exist > `- stopped @: i = 0; nth = 0 > > ** Message: AgsRecallFactory creating: ags-copy-pattern > ** Message: ags_channel_nth: > nth channel does not exist > `- stopped @: i = 0; nth = 0 > > ** Message: debug: AGS_IS_COPY_PATTERN_AUDIO_RUN(packable) > > > Program received signal SIGSEGV, Segmentation fault. > [Switching to Thread 0x7fffddffb700 (LWP 5183)] > ags_task_thread_append_task_queue (thread=0x97a010) > at ./src/ags/thread/ags_task_thread.c:264 > 264 task_thread = append->task_thread; > > > > > (gdb) make ags > gcc -DHAVE_CONFIG_H -I. -I./src/ -I/usr/include/uuid > -I/usr/include/alsa -I/usr/include/libxml2 > -I/usr/include/libinstpatch-1.0 -I/usr/include/glib-2.0 > -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread > -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include > -pthread -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 > -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libpng12 > -I/usr/include/cairo -I/usr/include/glib-2.0 > -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 > -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/libdrm > -pthread -I/usr/include/gtk-2.0 > -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 > -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 > -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ > -I/usr/include/freetype2 -I/usr/include/glib-2.0 > -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 > -I/usr/include/libpng12 -I/usr/include/libdrm -I/usr/include/harfbuzz > -g -O2 -MT ags-ags_returnable_thread.o -MD -MP > -MF .deps/ags-ags_returnable_thread.Tpo -c -o > ags-ags_returnable_thread.o `test -f > './src/ags/thread/ags_returnable_thread.c' || echo > './'`./src/ags/thread/ags_returnable_thread.c > In file included > from /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h:9:0, > from /usr/include/glib-2.0/glib/gtypes.h:34, > from /usr/include/glib-2.0/glib/galloca.h:34, > from /usr/include/glib-2.0/glib.h:32, > from ./src/ags/thread/ags_returnable_thread.h:22, > from ./src/ags/thread/ags_returnable_thread.c:19: > ./src/ags/thread/ags_returnable_thread.c: In function > 'ags_returnable_thread_init': > /usr/include/glib-2.0/glib/gmacros.h:181:53: error: size of array > '_GStaticAssertCompileTimeAssertion_1' is negative > #define G_STATIC_ASSERT(expr) typedef char G_PASTE > (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] > G_GNUC_UNUSED > ^ > /usr/include/glib-2.0/glib/gmacros.h:178:47: note: in definition of > macro 'G_PASTE_ARGS' > #define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## > identifier2 > ^ > /usr/include/glib-2.0/glib/gmacros.h:181:44: note: in expansion of macro > 'G_PASTE' > #define G_STATIC_ASSERT(expr) typedef char G_PASTE > (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] > G_GNUC_UNUSED > ^ > /usr/include/glib-2.0/glib/gatomic.h:154:5: note: in expansion of macro > 'G_STATIC_ASSERT' > G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gpointer)); > \ > ^ > ./src/ags/thread/ags_returnable_thread.c:108:3: note: in expansion of > macro 'g_atomic_pointer_set' > g_atomic_pointer_set((returnable_thread->safe_data), > ^ > ./src/ags/thread/ags_returnable_thread.c:108:3: error: invalid use of > void expression > In file included from /usr/include/glib-2.0/glib/gthread.h:34:0, > from /usr/include/glib-2.0/glib/gasyncqueue.h:34, > from /usr/include/glib-2.0/glib.h:34, > from ./src/ags/thread/ags_returnable_thread.h:22, > from ./src/ags/thread/ags_returnable_thread.c:19: > /usr/include/glib-2.0/glib/gatomic.h:156:5: warning: dereferencing 'void > *' pointer [enabled by default] > *(atomic) = (__typeof__ (*(atomic))) (gsize) (newval); > \ > ^ > ./src/ags/thread/ags_returnable_thread.c:108:3: note: in expansion of > macro 'g_atomic_pointer_set' > g_atomic_pointer_set((returnable_thread->safe_data), > ^ > ./src/ags/thread/ags_returnable_thread.c:108:3: error: invalid use of > void expression > make: *** [ags-ags_returnable_thread.o] Error 1 > > > > _______________________________________________ > gtk-app-devel-list mailing list > gtk-app-devel-list@gnome.org > https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
The following will compile but is it still correct? g_atomic_pointer_set(&(returnable_thread->safe_data), NULL); _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list