#include <stdio.h>
#include <stdarg.h>
#include <assert.h>
#include <sys/time.h>
#include "tmfe_rev0.h"
#include "midas.h"
#include "msystem.h"
#include "mrpc.h"
#include "mstrlcpy.h"
Go to the source code of this file.
◆ rpc_callback()
Definition at line 389 of file tmfe_rev0.cxx.
390{
395
397
399
400 for (
unsigned i=0;
i<
mfe->fRpcHandlers.size();
i++) {
401 std::string r =
mfe->fRpcHandlers[
i]->HandleRpc(cmd,
args);
402 if (r.length() > 0) {
403
406 }
407 }
408
411}
INT cm_msg(INT message_type, const char *filename, INT line, const char *routine, const char *format,...)
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)
◆ tmfe_periodic_thread()
Definition at line 232 of file tmfe_rev0.cxx.
233{
234 fprintf(
stderr,
"tmfe_periodic_thread: periodic thread started\n");
236 mfe->fPeriodicThreadRunning =
true;
237 while (!
mfe->fShutdownRequested && !
mfe->fPeriodicThreadShutdownRequested) {
238 mfe->EquipmentPeriodicTasks();
241 mfe->fShutdownRequested =
true;
242 fprintf(
stderr,
"tmfe_periodic_thread: ss_susend() status %d, shutdown requested...\n",
status);
243 }
244 }
246 fprintf(
stderr,
"tmfe_periodic_thread: periodic thread stopped\n");
247 mfe->fPeriodicThreadRunning =
false;
249}
INT ss_suspend(INT millisec, INT msg)
◆ tmfe_rpc_thread()
Definition at line 209 of file tmfe_rev0.cxx.
210{
212
215 mfe->fRpcThreadRunning =
true;
217 while (!
mfe->fShutdownRequested && !
mfe->fRpcThreadShutdownRequested) {
218
220
222 mfe->fShutdownRequested =
true;
224 }
225 }
228 mfe->fRpcThreadRunning =
false;
230}
INT cm_yield(INT millisec)
INT ss_suspend_set_rpc_thread(midas_thread_t thread_id)
midas_thread_t ss_gettid(void)
◆ tr_pause()
Definition at line 448 of file tmfe_rev0.cxx.
449{
451
453 for (
unsigned i=0;
i<
mfe->fRpcHandlers.size();
i++) {
454 mfe->fRpcHandlers[
i]->HandlePauseRun();
455 }
456
458}
◆ tr_resume()
Definition at line 460 of file tmfe_rev0.cxx.
461{
463
465 for (
unsigned i=0;
i<
mfe->fRpcHandlers.size();
i++) {
466 mfe->fRpcHandlers[
i]->HandleResumeRun();
467 }
468
470}
◆ tr_start()
Definition at line 413 of file tmfe_rev0.cxx.
414{
416
418
419 for (
unsigned i=0;
i<
mfe->fEquipments.size();
i++) {
420 mfe->fEquipments[
i]->ZeroStatistics();
421 mfe->fEquipments[
i]->WriteStatistics();
422 }
423
424 for (
unsigned i=0;
i<
mfe->fRpcHandlers.size();
i++) {
425 mfe->fRpcHandlers[
i]->HandleBeginRun();
426 }
427
429}
◆ tr_startabort()
Definition at line 472 of file tmfe_rev0.cxx.
473{
475
477 for (
unsigned i=0;
i<
mfe->fRpcHandlers.size();
i++) {
478 mfe->fRpcHandlers[
i]->HandleStartAbortRun();
479 }
480
482}
◆ tr_stop()
Definition at line 431 of file tmfe_rev0.cxx.
432{
434
436 for (
unsigned i=0;
i<
mfe->fRpcHandlers.size();
i++) {
437 mfe->fRpcHandlers[
i]->HandleEndRun();
438 }
439
440 for (
unsigned i=0;
i<
mfe->fEquipments.size();
i++) {
441 mfe->fEquipments[
i]->WriteStatistics();
442 }
443
444
446}