MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / alarm

Method alarm

source/kernel/kprocess.cpp:674–694  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

672}
673
674U32 KProcess::alarm(U32 seconds) {
675 U32 prev = this->timer.millies;
676 if (seconds == 0) {
677 if (this->timer.millies!=0) {
678 removeTimer(&this->timer);
679 this->timer.millies = 0;
680 }
681 } else {
682 this->timer.resetMillies = 0;
683 if (this->timer.millies!=0) {
684 this->timer.millies = seconds*1000 + KSystem::getMilliesSinceStart();
685 } else {
686 this->timer.millies = seconds*1000 + KSystem::getMilliesSinceStart();
687 addTimer(&this->timer);
688 }
689 }
690 if (prev) {
691 return (prev - KSystem::getMilliesSinceStart())/1000;
692 }
693 return 0;
694}
695
696std::shared_ptr<FsNode> KProcess::findInPath(BString path) {
697 std::shared_ptr<FsNode> node = Fs::getNodeFromLocalPath(this->currentDirectory, path, true);

Callers 1

syscall_alarmFunction · 0.80

Calls 2

removeTimerFunction · 0.85
addTimerFunction · 0.85

Tested by

no test coverage detected