title: Threading and pcap issues
body: <p>I have a GUI program that allows a user a scan a network, the issue is that when the pcap_loop function is called, my GUI program becomes unresponsive.(the pcap_loop blocks the current thread).</p>
  
  <p>When i try to use pthreads, i got a SIGSEGV fault at the pcap_loop function.Why?It's as if the thread can't see the procPacket function itself.</p>
  
  <pre><code>void procPacket(u_char *arg, const struct pcap_pkthdr *pkthdr, const u_char *packet)
  {
      //show packets here
  }
  void* pcapLooper(void* param)
  {
      pcap_t* handler = (pcap_t*) param;
      pcap_loop(handler, 900 ,procPacket, NULL );
  
  }
    //some function that runs when a button is pressed  
    //handler has been opened through pcap_open_live
     pthread_t scanner;
     int t = pthread_create(&amp;scanner,NULL,&amp;pcapLooper, &amp;handler );
     if(t)
     {
        std::cout &lt;&lt; "failed" &lt;&lt; std::endl;
     }
     pthread_join(scanner,NULL);
     //do other stuff.
  </code></pre>