Add g_get_num_processors()

Based on a patch from John Cupitt <jcupitt@gmail.com>

Useful for thread pools which should scale to number of processors.

See https://bugzilla.gnome.org/show_bug.cgi?id=687223

https://bugzilla.gnome.org/show_bug.cgi?id=614930
This commit is contained in:
Colin Walters
2012-12-17 10:47:53 -05:00
parent ed5accf16c
commit 2149b29468
5 changed files with 69 additions and 4 deletions

View File

@@ -249,6 +249,9 @@ void g_once_init_leave (volatile void *location,
(g_once_init_leave((location), (gsize) (result)))
#endif
GLIB_AVAILABLE_IN_2_36
guint g_get_num_processors (void);
G_END_DECLS
#endif /* __G_THREAD_H__ */