Jinoh Kang (@iamahuman) commented about server/thread.c:
- {
struct wait_completion_packet *packet;
LIST_FOR_EACH_ENTRY( packet, &obj->wait_completion_packet_queue, struct wait_completion_packet, entry )
{
list_remove( &packet->entry );
release_object( packet->target );
packet->in_object_packet_queue = 0;
packet->target = NULL;
add_completion( packet->completion, packet->ckey, packet->cvalue, packet->status,
packet->information, packet );
packet->in_completion_queue = 1;
}
- }
General advice: you should try not to leak implementation details of certain object (wait completion packet) into other types of objects.
For example, if this piece of code is still to be preserved, you should move this into a helper completion.c, declare as extern in object.h (or file.h), and call that.
That way, you don't have to define the entire `struct wait_completion_packet` in a shared header file. If this were factored into a helper, a simple forward declaration would have sufficed in the `file.h` side.