Skip to content

Instantly share code, notes, and snippets.

View lighth7015's full-sized avatar
Perpetually exhausted.

Robert Butler lighth7015

Perpetually exhausted.
View GitHub Profile
@michahoiting
michahoiting / c-vtable.c
Created April 12, 2016 13:23
vtable example in C
#include <stdio.h>
/* class definitions */
typedef struct Base
{
void (**vtable)();
int _x;
} Base;
typedef struct Child
@zhangyuchi
zhangyuchi / thread_libev.cc
Created December 24, 2014 07:31
multithread libev exsample, cross thread notify
//This program is demo for using pthreads with libev.
//Try using Timeout values as large as 1.0 and as small as 0.000001
//and notice the difference in the output
//(c) 2009 debuguo
//(c) 2013 enthusiasticgeek for stack overflow
//Free to distribute and improve the code. Leave credits intact
#include <ev.h>
#include <stdio.h> // for puts
@b4n
b4n / threading.c
Created August 27, 2012 09:07
Threading with GTK
#include <gtk/gtk.h>
typedef struct
{
GtkWidget *window;
guint progress_id;
} WorkerData;
@austinmarton
austinmarton / linux_timerfd_example.c
Created July 13, 2012 09:23
Linux file descriptor timers example
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.