• std::cout makes the next task creation to get deleted automatically

    From atul.singh008@gmail.com@21:1/5 to All on Tue Jan 5 21:02:39 2016
    Hi All,

    I am working on vxworks with the testcase as:
    **********************
    int main(int argc, char* argv[]) {
    TASK_ID id;
    printf("Task spawn 0x%x\n", id = taskSpawn((char*)"JobA", 127, VX_FP_TASK, 12u * 1024u, (FUNCPTR)Job, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
    taskDelay(5);
    printf("Task delete %d\n", taskDelete(id));

    std::cout << ""; /* <= REMOVING THIS LINE "SOLVES" THE PROBLEM*/

    printf("Task spawn 0x%x\n", id = taskSpawn((char*)"JobB", 127, VX_FP_TASK, 12u * 1024u, (FUNCPTR)Job, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
    taskDelay(5);
    errnoSet(0);
    STATUS result = taskDelete(id);
    int e = errnoGet();
    printf("Task delete %d\n", result);
    printf("Errno = %d\n", e);
    **********************

    But here when i invoke "std::cout" then the next task will automatically get deleted before invoking the actual taskDelete API.

    Also here the error is not reported when i invoke the taskDelete API.
    The behavior i am seeing is:
    +++++++++++++++++++++
    Task spawn 0x330032
    job: 1
    Task delete 0
    Task spawn 0x350034
    job: 1
    Task delete -1 ---> taskDelete after "::std::cout"
    Errno = 0
    +++++++++++++++++++++

    Please help me on this.
    Thanks in advance.

    Regards,
    Atul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Atul@21:1/5 to Atul on Tue Feb 2 20:45:31 2016
    On Wednesday, 6 January 2016 10:32:43 UTC+5:30, Atul wrote:
    Hi All,

    I am working on vxworks with the testcase as:
    **********************
    int main(int argc, char* argv[]) {
    TASK_ID id;
    printf("Task spawn 0x%x\n", id = taskSpawn((char*)"JobA", 127, VX_FP_TASK, 12u * 1024u, (FUNCPTR)Job, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
    taskDelay(5);
    printf("Task delete %d\n", taskDelete(id));

    std::cout << ""; /* <= REMOVING THIS LINE "SOLVES" THE PROBLEM*/

    printf("Task spawn 0x%x\n", id = taskSpawn((char*)"JobB", 127, VX_FP_TASK, 12u * 1024u, (FUNCPTR)Job, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
    taskDelay(5);
    errnoSet(0);
    STATUS result = taskDelete(id);
    int e = errnoGet();
    printf("Task delete %d\n", result);
    printf("Errno = %d\n", e);
    **********************

    But here when i invoke "std::cout" then the next task will automatically get deleted before invoking the actual taskDelete API.

    Also here the error is not reported when i invoke the taskDelete API.
    The behavior i am seeing is:
    +++++++++++++++++++++
    Task spawn 0x330032
    job: 1
    Task delete 0
    Task spawn 0x350034
    job: 1
    Task delete -1 ---> taskDelete after "::std::cout"
    Errno = 0
    +++++++++++++++++++++

    Please help me on this.
    Thanks in advance.

    Regards,
    Atul

    Any suggestion on the issue i am facing will be highly appreciated...:)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)