X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=markpool.h;fp=markpool.h;h=0000000000000000000000000000000000000000;hp=f90aeeab2bd00b5f6919b5aabe923d0efff3be78;hb=5cc8cd703a637e276c2595953878fd9561592bfa;hpb=b9d939606ebaf69e2c5a5d8b3e2d8e9adc0e69ae diff --git a/markpool.h b/markpool.h deleted file mode 100644 index f90aeea..0000000 --- a/markpool.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef _MARKPOOL_H -#define _MARKPOOL_H - -// A class that hands out fwmarks from a given range in a thread-safe fashion. -// If the range is empty, it returns 0. - -#include -#include - -class MarkPool { -public: - // Limits are [start, end>. Numbers are 16-bit, so above 65535 do not make sense. - MarkPool(int start, int end); - - int get_mark(); - void release_mark(int mark); - -private: - int start, end; - - pthread_mutex_t mutex; - std::queue free_marks; -}; - -#endif // !defined(_MARKPOOL_H)