nine_queue.h revision ac2927335bc7cd4994d2fc0906eb328773b1f923
13af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph/* 23af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph * Copyright 2016 Patrick Rudolph <siro@das-labor.org> 33af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph * 43af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph * Permission is hereby granted, free of charge, to any person obtaining a 53af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph * copy of this software and associated documentation files (the "Software"), 63af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph * to deal in the Software without restriction, including without limitation 73af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph * on the rights to use, copy, modify, merge, publish, distribute, sub 83af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph * license, and/or sell copies of the Software, and to permit persons to whom 93af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph * the Software is furnished to do so, subject to the following conditions: 103af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph * 113af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph * The above copyright notice and this permission notice (including the next 123af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph * paragraph) shall be included in all copies or substantial portions of the 133af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph * Software. 143af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph * 153af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 163af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 173af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 183af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, 193af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 203af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 213af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph * USE OR OTHER DEALINGS IN THE SOFTWARE. */ 223af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph 233af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph#ifndef _NINE_QUEUE_H_ 243af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph#define _NINE_QUEUE_H_ 253af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph 263af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph#include "pipe/p_compiler.h" 273af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph 283af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolphstruct nine_queue_pool; 293af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph 303af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolphvoid 313af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolphnine_queue_wait_flush(struct nine_queue_pool* ctx); 323af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph 333af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolphvoid * 343af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolphnine_queue_get(struct nine_queue_pool* ctx); 353af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph 363af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolphvoid 373af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolphnine_queue_flush(struct nine_queue_pool* ctx); 383af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph 393af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolphvoid * 403af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolphnine_queue_alloc(struct nine_queue_pool* ctx, unsigned space); 413af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph 42ac2927335bc7cd4994d2fc0906eb328773b1f923Patrick Rudolphbool 43ac2927335bc7cd4994d2fc0906eb328773b1f923Patrick Rudolphnine_queue_isempty(struct nine_queue_pool* ctx); 44ac2927335bc7cd4994d2fc0906eb328773b1f923Patrick Rudolph 453af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolphstruct nine_queue_pool* 463af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolphnine_queue_create(void); 473af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph 483af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolphvoid 493af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolphnine_queue_delete(struct nine_queue_pool *ctx); 503af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph 513af17a671d871e725967a74617e5adb2e985e6efPatrick Rudolph#endif /* _NINE_QUEUE_H_ */ 52