MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / remove

Method remove

Kernel/include/list.h:410–437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

408 }
409
410 void remove(T val){
411 if(num <= 0 || !front){
412 return;
413 }
414
415 acquireLock(&lock);
416
417 ListNode<T>* current = front;
418
419 while(current && current != back && current->obj != val) current = current->next;
420
421 if(current){
422 current->prev->next = current->next;
423 current->next->prev = current->prev;
424 if (front == current) front = current->next;
425 if (back == current) back = current->prev;
426
427 num--;
428
429 if(cache.get_length() >= maxCache){
430 kfree(current);
431 } else {
432 cache.add_back(current);
433 }
434 }
435
436 releaseLock(&lock);
437 }
438
439
440 void remove(ListIterator<T>& it){

Callers 15

SetActiveMethod · 0.45
PollMethod · 0.45
StopWaitingOnMethod · 0.45
StopWaitingOnAllMethod · 0.45
~WaiterMethod · 0.45
WaitTimeoutMethod · 0.45
RemoveThreadFromQueueFunction · 0.45
EndProcessFunction · 0.45
RemoveMethod · 0.45
UnwatchMasterMethod · 0.45
UnwatchSlaveMethod · 0.45
DestroyMethod · 0.45

Calls 3

kfreeFunction · 0.85
get_lengthMethod · 0.45
add_backMethod · 0.45

Tested by

no test coverage detected