code: func DialWithTimeout(url string, sessionNum int, dialTimeout time.Duration, timeout time.Duration) (*DialContext, error) {
  	if sessionNum <= 0 {
  		sessionNum = 100
  		log.Release("invalid sessionNum, reset to %v", sessionNum)
  	}
  
  	s, err := mgo.DialWithTimeout(url, dialTimeout)
  	if err != nil {
  		return nil, err
  	}
  	s.SetSyncTimeout(timeout)
  	s.SetSocketTimeout(timeout)
  
  	c := new(DialContext)
  
  	// sessions
  	c.sessions = make(SessionHeap, sessionNum)
  	c.sessions[0] = &Session{s, 0, 0}
  	for i := 1; i < sessionNum; i++ {
  		c.sessions[i] = &Session{s.New(), 0, i}
  	}
  	heap.Init(&c.sessions)
  
  	return c, nil
  }
docs: // goroutine safe