示例#1
0
void bmp_draw_horiz_line(struct image_t *bmp, unsigned left, unsigned right, unsigned y, unsigned color) {
    assert(left <= right);

    while (left <= right) {
        bmp_set_bit(bmp, left++, y, color);
    }
}
示例#2
0
void bmp_draw_vert_line(struct image_t *bmp, unsigned top, unsigned bottom, unsigned x, unsigned color) {
    assert(top <= bottom);

    while (top <= bottom) {
        bmp_set_bit(bmp, x, top++, color);
    }
}
示例#3
0
/*
Return the thread(tid) to thread_pool as free
*/
void tp_free_thread(struct thread_pool *pool, int tid)
{
    pthread_mutex_lock(&pool->mutex);

    //pool->bitmap |= (1<<(tid));
    bmp_set_bit(&pool->bitmap, tid);    // mark the bit "tid" to "1" as free

    dbg("tpool %s: free tpid %d, bitmap== \n", pool->name, tid);    //, pool->bitmap);
    //bmp_dump( &pool->bitmap);

    pthread_mutex_unlock(&pool->mutex);
    //dbg(" free thread %d\n", tid);

}