src/net/java/sip/communicator/impl/packetlogging/PacketLoggingServiceImpl.java
/**
         * Sends instant messages in separate thread so we don't block
         * our calling thread.
         */
Sends instant messages in separate thread so we don't block
our calling thread.
Sends instant messages in separate thread so we don ' t block our calling thread .
@Override
        public void run()
        {
            stopped = false;
            while(!stopped)
            {
                Packet pktToSave;
                synchronized(this)
                {
                    if(pktsToSave.isEmpty())
                    {
                        try
                        {
                            wait();
                        }
                        catch (InterruptedException iex)
                        {
                        }
                        continue;
                    }
                    pktToSave = pktsToSave.poll();
                }
                if(pktToSave != null)
                {
                    try
                    {
                        savePacket(pktToSave);
                    }
                    catch(Throwable t)
                    {
                        /*
                         * XXX ThreadDeath must be rethrown; otherwise, the
                         * related Thread will not die.
                         */
                        if (t instanceof ThreadDeath)
                            throw (ThreadDeath) t;
                        else
                            logger.error("Error writing packet to file", t);
                    }
                }
            }
        }
@ Override public void run ( ) { stopped = false ; while ( ! stopped ) { Packet pktToSave ; synchronized ( this ) { if ( pktsToSave . isEmpty ( ) ) { try { wait ( ) ; } catch ( InterruptedException iex ) { } continue ; } pktToSave = pktsToSave . poll ( ) ; } if ( pktToSave != null ) { try { savePacket ( pktToSave ) ; } catch ( Throwable t ) { /*
                         * XXX ThreadDeath must be rethrown; otherwise, the
                         * related Thread will not die.
                         */ if ( t instanceof ThreadDeath ) throw ( ThreadDeath ) t ; else logger . error ( "Error writing packet to file" , t ) ; } } } }
Sends instant messages in separate thread so we don't block
 our calling thread.
Sends instant messages in separate thread so we don ' t block our calling thread .