MCPcopy Create free account
hub / github.com/apache/trafficserver / cont_schedule_handler

Function cont_schedule_handler

src/api/InkAPITest.cc:2629–2658  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2627static int tc2_count = 0;
2628
2629int
2630cont_schedule_handler(TSCont contp, TSEvent event, void * /* edata ATS_UNUSED */)
2631{
2632 if (event == TS_EVENT_IMMEDIATE) {
2633 // Test Case 1
2634 SDK_RPRINT(SDK_ContSchedule_test, "TSContScheduleOnPool", "TestCase1", TC_PASS, "ok");
2635 tc1_count++;
2636 } else if (event == TS_EVENT_TIMEOUT) {
2637 // Test Case 2
2638 SDK_RPRINT(SDK_ContSchedule_test, "TSContScheduleOnPool", "TestCase2", TC_PASS, "ok");
2639 tc2_count++;
2640 } else {
2641 // If we receive a bad event, it's a failure
2642 SDK_RPRINT(SDK_ContSchedule_test, "TSContScheduleOnPool", "TestCase1|2", TC_FAIL, "received unexpected event number %d", event);
2643 *SDK_ContSchedule_pstatus = REGRESSION_TEST_FAILED;
2644 return 0;
2645 }
2646
2647 // We expect to be called once for TC1 and once for TC2
2648 if ((tc1_count == 1) && (tc2_count == 1)) {
2649 *SDK_ContSchedule_pstatus = REGRESSION_TEST_PASSED;
2650 }
2651 // If TC1 or TC2 executed more than once, something is fishy..
2652 else if (tc1_count + tc2_count >= 2) {
2653 *SDK_ContSchedule_pstatus = REGRESSION_TEST_FAILED;
2654 }
2655
2656 TSContDestroy(contp);
2657 return 0;
2658}
2659
2660/* Mutex */
2661

Callers

nothing calls this directly

Calls 2

SDK_RPRINTFunction · 0.85
TSContDestroyFunction · 0.85

Tested by

no test coverage detected