Revision: 56388
          http://sourceforge.net/p/brlcad/code/56388
Author:   mohitdaga
Date:     2013-07-31 16:58:08 +0000 (Wed, 31 Jul 2013)
Log Message:
-----------
Applying seamaphore locks  after modifying icv_writeline(..). This now doesnt 
hang since icv_writeline doesnt ask for memory allocation any more. Thus 
doesn't acquire BU_SEM_SYSCALL. This is expected to ensure sanctity in image 
writting from rt.

Modified Paths:
--------------
    brlcad/trunk/src/rt/view.c
    brlcad/trunk/src/rt/viewedge.c
    brlcad/trunk/src/rt/viewxray.c

Modified: brlcad/trunk/src/rt/view.c
===================================================================
--- brlcad/trunk/src/rt/view.c  2013-07-31 14:26:29 UTC (rev 56387)
+++ brlcad/trunk/src/rt/view.c  2013-07-31 16:58:08 UTC (rev 56388)
@@ -315,7 +315,9 @@
                p[2] = b;
 
                if (bif != NULL) {
+                   bu_semaphore_acquire(BU_SEM_SYSCALL);
                    icv_writepixel(bif, ap->a_x, ap->a_y, ap->a_color);
+                   bu_semaphore_release(BU_SEM_SYSCALL);
                } else if (outfp != NULL) {
                    bu_semaphore_acquire(BU_SEM_SYSCALL);
                    if (bu_fseek(outfp, (ap->a_y*width*pwidth) + 
(ap->a_x*pwidth), 0) != 0)
@@ -566,7 +568,9 @@
            }
            if (bif != NULL) {
                /* TODO : Add double type data to maintain resolution */
+               bu_semaphore_acquire(BU_SEM_SYSCALL);
                icv_writeline(bif, ap->a_y, (unsigned char 
*)scanline[ap->a_y].sl_buf, ICV_DATA_UCHAR);
+               bu_semaphore_release(BU_SEM_SYSCALL);
            } else if (outfp != NULL) {
                size_t count;
 

Modified: brlcad/trunk/src/rt/viewedge.c
===================================================================
--- brlcad/trunk/src/rt/viewedge.c      2013-07-31 14:26:29 UTC (rev 56387)
+++ brlcad/trunk/src/rt/viewedge.c      2013-07-31 16:58:08 UTC (rev 56388)
@@ -816,8 +816,10 @@
        /*
         * Write to a file.
         */
+       bu_semaphore_acquire(BU_SEM_SYSCALL);
        /* TODO : Add double type data to maintain resolution */
        icv_writeline(bif, ap->a_y, scanline[cpu],  ICV_DATA_UCHAR);
+       bu_semaphore_release(BU_SEM_SYSCALL);
     }
     if (fbp == FBIO_NULL && outputfile == NULL)
        bu_log("rtedge: strange, no end of line actions taken.\n");

Modified: brlcad/trunk/src/rt/viewxray.c
===================================================================
--- brlcad/trunk/src/rt/viewxray.c      2013-07-31 14:26:29 UTC (rev 56387)
+++ brlcad/trunk/src/rt/viewxray.c      2013-07-31 16:58:08 UTC (rev 56388)
@@ -175,8 +175,10 @@
            if (rt_g.rtg_parallel) {
                bu_semaphore_acquire( BU_SEM_SYSCALL );
            }
+           bu_semaphore_acquire(BU_SEM_SYSCALL);
            /* TODO : Add double type data to maintain resolution */
            icv_writeline(bif, ap->a_y, scanbuf, ICV_DATA_UCHAR);
+           bu_semaphore_release(BU_SEM_SYSCALL);
            if (rt_g.rtg_parallel) {
                bu_semaphore_release( BU_SEM_SYSCALL );
            }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to