コード例 #1
0
        /* inline helper to queue a single work item using the same interface */
        public osd_work_item osd_work_item_queue(osd_work_queue queue, osd_work_callback callback, Object param, uint32_t flags)
        {
            List <Object> parambase = new List <object>();

            parambase.Add(param);
            return(osd_work_item_queue_multiple(queue, callback, 1, parambase, /*0,*/ flags));
        }
コード例 #2
0
ファイル: osdcore_Unity.cs プロジェクト: kwanboy/mcs
 /*-----------------------------------------------------------------------------
 *   osd_work_item_queue_multiple: queue a set of work items
 *
 *   Parameters:
 *
 *       queue - pointer to an osd_work_queue that was previously created via
 *           osd_work_queue_alloc
 *
 *       callback - pointer to a function that will do the work
 *
 *       numitems - number of work items to queue
 *
 *       param - a void * parameter that can be used to pass data to the
 *           function
 *
 *       paramstep - the number of bytes to increment param by for each item
 *           queued; for example, if you have an array of work_unit objects,
 *           you can point param to the base of the array and set paramstep to
 *           sizeof(work_unit)
 *
 *       flags - one or more of the WORK_ITEM_FLAG_* values ORed together:
 *
 *           WORK_ITEM_FLAG_AUTO_RELEASE - indicates that the work item
 *               should be automatically freed when it is complete
 *
 *   Return value:
 *
 *       A pointer to the final allocated osd_work_item in the list.
 *
 *   Notes:
 *
 *       On single-threaded systems, this function may actually execute the
 *       work item immediately before returning.
 *  -----------------------------------------------------------------------------*/
 public override osd_work_item osd_work_item_queue_multiple(osd_work_queue queue, osd_work_callback callback, int numitems, List <Object> parambase, /*int paramstep,*/ UInt32 flags)
 {
     return(null);
 }
コード例 #3
0
ファイル: osdcore_Unity.cs プロジェクト: kwanboy/mcs
 /*-----------------------------------------------------------------------------
 *   osd_work_queue_free: free a work queue, waiting for all items to complete
 *
 *   Parameters:
 *
 *       queue - pointer to an osd_work_queue that was previously created via
 *           osd_work_queue_alloc
 *
 *   Return value:
 *
 *       None.
 *  -----------------------------------------------------------------------------*/
 public override void osd_work_queue_free(osd_work_queue queue)
 {
 }
コード例 #4
0
ファイル: osdcore_Unity.cs プロジェクト: kwanboy/mcs
        /*-----------------------------------------------------------------------------
        *   osd_work_queue_items: return the number of pending items in the queue
        *
        *   Parameters:
        *
        *       queue - pointer to an osd_work_queue that was previously created via
        *           osd_work_queue_alloc
        *
        *   Return value:
        *
        *       The number of incomplete items remaining in the queue.
        *  -----------------------------------------------------------------------------*/
        //int osd_work_queue_items(osd_work_queue *queue);


        /*-----------------------------------------------------------------------------
        *   osd_work_queue_wait: wait for the queue to be empty
        *
        *   Parameters:
        *
        *       queue - pointer to an osd_work_queue that was previously created via
        *           osd_work_queue_alloc
        *
        *       timeout - a timeout value in osd_ticks_per_second()
        *
        *   Return value:
        *
        *       TRUE if the queue is empty; FALSE if the wait timed out before the
        *       queue was emptied.
        *  -----------------------------------------------------------------------------*/
        public override bool osd_work_queue_wait(osd_work_queue queue, osd_ticks_t timeout)
        {
            return(true);
        }
コード例 #5
0
 /*-----------------------------------------------------------------------------
 *   osd_work_item_queue_multiple: queue a set of work items
 *
 *   Parameters:
 *
 *       queue - pointer to an osd_work_queue that was previously created via
 *           osd_work_queue_alloc
 *
 *       callback - pointer to a function that will do the work
 *
 *       numitems - number of work items to queue
 *
 *       param - a void * parameter that can be used to pass data to the
 *           function
 *
 *       paramstep - the number of bytes to increment param by for each item
 *           queued; for example, if you have an array of work_unit objects,
 *           you can point param to the base of the array and set paramstep to
 *           sizeof(work_unit)
 *
 *       flags - one or more of the WORK_ITEM_FLAG_* values ORed together:
 *
 *           WORK_ITEM_FLAG_AUTO_RELEASE - indicates that the work item
 *               should be automatically freed when it is complete
 *
 *   Return value:
 *
 *       A pointer to the final allocated osd_work_item in the list.
 *
 *   Notes:
 *
 *       On single-threaded systems, this function may actually execute the
 *       work item immediately before returning.
 *  -----------------------------------------------------------------------------*/
 public override osd_work_item osd_work_item_queue_multiple(osd_work_queue queue, osd_work_callback callback, int32_t numitems, List <Object> parambase, /*int paramstep,*/ uint32_t flags)
 {
     return(osdsync_global.osd_work_item_queue_multiple(queue, callback, numitems, parambase, /*paramstep,*/ flags));
 }
コード例 #6
0
 /*-----------------------------------------------------------------------------
 *   osd_work_queue_free: free a work queue, waiting for all items to complete
 *
 *   Parameters:
 *
 *       queue - pointer to an osd_work_queue that was previously created via
 *           osd_work_queue_alloc
 *
 *   Return value:
 *
 *       None.
 *  -----------------------------------------------------------------------------*/
 public override void osd_work_queue_free(osd_work_queue queue)
 {
     osdsync_global.osd_work_queue_free(queue);
 }
コード例 #7
0
        /*-----------------------------------------------------------------------------
        *   osd_work_queue_items: return the number of pending items in the queue
        *
        *   Parameters:
        *
        *       queue - pointer to an osd_work_queue that was previously created via
        *           osd_work_queue_alloc
        *
        *   Return value:
        *
        *       The number of incomplete items remaining in the queue.
        *  -----------------------------------------------------------------------------*/
        //int osd_work_queue_items(osd_work_queue *queue);


        /*-----------------------------------------------------------------------------
        *   osd_work_queue_wait: wait for the queue to be empty
        *
        *   Parameters:
        *
        *       queue - pointer to an osd_work_queue that was previously created via
        *           osd_work_queue_alloc
        *
        *       timeout - a timeout value in osd_ticks_per_second()
        *
        *   Return value:
        *
        *       TRUE if the queue is empty; FALSE if the wait timed out before the
        *       queue was emptied.
        *  -----------------------------------------------------------------------------*/
        public override bool osd_work_queue_wait(osd_work_queue queue, osd_ticks_t timeout)
        {
            return(osdsync_global.osd_work_queue_wait(queue, timeout));
        }
コード例 #8
0
 /*-----------------------------------------------------------------------------
 *   osd_work_item_queue_multiple: queue a set of work items
 *
 *   Parameters:
 *
 *       queue - pointer to an osd_work_queue that was previously created via
 *           osd_work_queue_alloc
 *
 *       callback - pointer to a function that will do the work
 *
 *       numitems - number of work items to queue
 *
 *       param - a void * parameter that can be used to pass data to the
 *           function
 *
 *       paramstep - the number of bytes to increment param by for each item
 *           queued; for example, if you have an array of work_unit objects,
 *           you can point param to the base of the array and set paramstep to
 *           sizeof(work_unit)
 *
 *       flags - one or more of the WORK_ITEM_FLAG_* values ORed together:
 *
 *           WORK_ITEM_FLAG_AUTO_RELEASE - indicates that the work item
 *               should be automatically freed when it is complete
 *
 *   Return value:
 *
 *       A pointer to the final allocated osd_work_item in the list.
 *
 *   Notes:
 *
 *       On single-threaded systems, this function may actually execute the
 *       work item immediately before returning.
 *  -----------------------------------------------------------------------------*/
 public abstract osd_work_item osd_work_item_queue_multiple(osd_work_queue queue, osd_work_callback callback, int32_t numitems, List <Object> parambase, /*int paramstep,*/ uint32_t flags);
コード例 #9
0
 /*-----------------------------------------------------------------------------
 *   osd_work_queue_free: free a work queue, waiting for all items to complete
 *
 *   Parameters:
 *
 *       queue - pointer to an osd_work_queue that was previously created via
 *           osd_work_queue_alloc
 *
 *   Return value:
 *
 *       None.
 *  -----------------------------------------------------------------------------*/
 public abstract void osd_work_queue_free(osd_work_queue queue);
コード例 #10
0
        /*-----------------------------------------------------------------------------
        *   osd_work_queue_items: return the number of pending items in the queue
        *
        *   Parameters:
        *
        *       queue - pointer to an osd_work_queue that was previously created via
        *           osd_work_queue_alloc
        *
        *   Return value:
        *
        *       The number of incomplete items remaining in the queue.
        *  -----------------------------------------------------------------------------*/
        //int osd_work_queue_items(osd_work_queue *queue);


        /*-----------------------------------------------------------------------------
        *   osd_work_queue_wait: wait for the queue to be empty
        *
        *   Parameters:
        *
        *       queue - pointer to an osd_work_queue that was previously created via
        *           osd_work_queue_alloc
        *
        *       timeout - a timeout value in osd_ticks_per_second()
        *
        *   Return value:
        *
        *       true if the queue is empty; false if the wait timed out before the
        *       queue was emptied.
        *  -----------------------------------------------------------------------------*/
        public abstract bool osd_work_queue_wait(osd_work_queue queue, osd_ticks_t timeout);